Make an object appear in front of the character

Hello everyone,

I would like to make an item from the inventory appear in front of my character. However when I use “Attach Actor To Component” the character flies away with the object in front of him.

What to do ?

Thank you in advance for your answers.

sounds line a collisions problem: your object collides into character and they try move away from each other, but unfortunately they are attached one to another so they keep flying.

The simple solution would be to disable collision on item from inventory’s mesh (and its other components if any)

Thanks for your answer, but unfortunately it doesn’t work

Make actor that reads location and forward vector of character (using tick).

Then make it update self location to location of character plus (some value times forward character vector; some value times right vector; some value times up vector) to make offset.

However remember this solution is for single item and single player (it is bit heavy to make multiple items like that at once).

When you have that actor , add logic to hide it (change visibility( and toi change its mesh component.

Thanks, could it be simpler?

It couldn’t be simpler!
Thank you, Bless God.

Pretty standard is to add all objects a Pawn / Player is carrying to their MoveIgnore list.

APawn::MoveIgnoreActorAdd | Unreal Engine 5.2 Documentation

Add to move ignore list when equipping and remove when they drop it.

I don’t use blueprints but I think this is the equivalent:

Ignore Actor when Moving | Unreal Engine Documentation

1 Like