Download

Enemy grabbing problem

Hi All,

I am having a little problem with collision detection / interaction set up, usually I like to look on the forum and doc to find the answer but for this one I’m clueless.
I am trying to get a pawn (player) to grab another pawn (enemy) when the player is facing an enemy and a key is press. The way I see it, it’s to add a sphere component to the player BP; when a key is press the player look if an enemy is inside the sphere component and if yes it does something. I am having a problem to make the player and enemy “talked” to each other.

So far I try to add a Begin Overlap Event in the enemy BP that change its color when it gets touch by the player. When the player gets close to an enemy it changes the color (that working) but some of the spawned enemy get spawned with their color change already (not sure why). I’m not sure if that the right approach, it seems weird that the enemy BP is the one who check if the player collide with him and if that the right way I don’t know how to tell the enemy do to something when a key is pressed in the player BP.

I also try to use the Overlap Actor connected to a key input node in the player BP, but the player does not detect anything when the key is next to an enemy (I probably did not set the node properly).

Hopefully the post it not to confusing.

It sounds like you are not checking correctly if it was the player that entered the area around the enemy. This would explain why they have their colour changed from the start.
The image below seems to work better than just casting to the player.
OverlapPlayerLogic.JPG

If you show your enemy blueprint, that would help a lot.

Thanks you SuperNovaBen that fix the problem for the color and it also helped me to get the grabbing working.