I’m using ‘launch character’ to move an enemy forward by using ‘get actor forward vector’. It works as intended when I’m on the ground. However if I jump the enemy also jumps. Why ? He supposed to be on the ground always. I’m not sure if it’s important but I’m using ‘AI move to’ so the enemy can follow me.
Hey @Pinteco!
It’s possible that your input system is using the jump input for all characters in the scene with that code implemented. If it’s a child of the player character’s BP, for instance, or if you are calling jump on a keyboard action instead of an input.
If that’s not enough info, throw us a video of what’s happening, some screenshots of the code… just more info would be helpful to figuring out how to help you with this
Is there a way to disable jump for all characters except for myself?
Video: 2022-12-07 14-55-24
As you can see, the enemy leaves the ground if I jump.
Ahhhhh, that is almost definitely something in the attack code. Can you show me screenshots of any code for the zombie’s attack? It’s probably lunging toward player location, you should change it to not include the Z location.
Ok, I’ve splitted the vector of ‘get actor forward location’ and now I multiply only the X and Y by 2000 and don’t change the Z value. It has fixed now. Another problem is that the same thing is happening when I use ‘set actor location’. I tried to ignore the Z value but this causes the enemy to fall through the ground.
What the image supposed to do is: take the player location and make the enemy move towards this location using ‘set actor location’. The thing is that If the player is in the air, the enemy will also be in the air. I tried to ignore the Z value of player location but this makes the enemy fall through the floor. image:
This doesn’t fix things as before. What should I do?
Hey Pinteco!
Honest mistake. That 0 in the location Z is sending it toward world 0Z. So you need to get your current location, grab the Z and set it as the Z for your Vector
Thanks for help, it’s working now