How to change character mesh

I want the character to be able to line trace into a mesh, and if the mesh is in the mesh array, the character’s static mesh will be changed into whatever they looked at. I have an idea of what to do but am running into problems beyond my knowledge. The “MeshArray” variable has two static meshes in it right now: the starter content chair and table. E is the input action. I just put both to see if it would work.

EDIT: I am in the first person shooter template. Also, my line trace seems to only go one direction.

Prop hunt much? all you need to do is to get the mesh of the hit actor and do foreach (with break will be nice) search in the array, and if its true save its index and then change your mesh with the index.

How do I get the mesh of the hit actor

You cast it and then drag its mesh component(static mesh or skeletal mesh, one can’t be the other so be sure both of the the same type).

What do I cast it to? Sorry, I’m new to this thinking on my own stuff.

Could you just tell me the nodes to add? :slight_smile: I can do the connecting.

It depends, I guess your props are a pawn so casting it to a pawn should be alright(but if so make sure that you make them as a pawn and not character or an actor, character have too many unnecessary components and actor, you most cast it to the actor you create and do children from that actor for each of your props(best for advance games but I don’t think you need it), so make sure that they created as a pawn).

I told you all what you need, all what left is to make it and learn from mistakes. Good luck

After interpreting your gibberish, I have figured out how to do it without arrays; it seems much simpler to me.