Hi, in my game there is an ability where whenever is hit, the player teleports behind the enemy that attacked him rather than receiving damage. However, I can’t find a way to always get behind the enemy. I tried to set world location like this but of course the player gets teleported regardless of where the enemy is looking at (I basically want to teleport behind his back). Any help?
This works, but just out of curiosity, what’s the difference between “teleport” and “set location”?
Set Actor Location
is quite happy to just jam something inside the geometry, intersecting things like there’s no tomorrow. Teleport
is a bit more subtle and will try to find some wiggle room, similar to this:
Another difference is that:
Allows you to move things and respect physics sim behaviour while the actor is instantaneously repositioned - this may result in an infinite shift in velocity and confuse PhysX.
Another thing is Sweep
on the Set Actor Location node - it’s a method of detecting collisions between points A and B. Were you to Set Actor Location but there’s an obstacle in the away, Sweep will generate a Hit Event where collision would have happened. It has a lot of applications and some limitations, too.