SetActorLocation sets Pawn to wrong Location

HI, I want the pawn that the player controls, no matter what his Z or Y coordinate is, to have the X coordinate set to 3200. This happens when a box trigger is hit from which you can see the blueprint above. Unfortunately after hitting the BoxTrigger the X coordinate is not 3200 but about 10,000,000. Why is that and how do I solve the problem?

No, changes nothing.

I think you might need a DoOnce in there. Overlap is not a nice neat thing, it can trigger more than once…

EDIT: Also a good idea to cast to the player, any other actor could be triggering the collision:

I have no idea why at the moment, but if you code it with the nodes I used there, it works. But it doesn’t work with your nodes…

EDIT: Scratch that, I copied your network and wired it up wrong. They both work:

303280-jump.gif

I’m still being catapulted to 10,000,000. I use a normal Pawn with PawnFloatingMovement.

So could it be a bug?

The thing is that I am using an already quite large Pawn class written by me in C++ and a character would be absolute overkill. Why doesn’t it work for Pawns with PawnFloatingMovement? That can’t be possible at all.

But in any case, thank you very much for dealing with the problem so much.

It’s defintely not a bug. I’ve been trying to fix it.

I think you’re using the wrong kind of pawn. Will come back soon…

Ok, if you delete the floating pawn movement.

Then change the parent class to Character ( which gives you character movement ), then change default mode to flying and set the breaking friction factor to 100.

You get the same movement feel, but you can use set actor location.

Yes, sorry, can’t find anything regarding it…

I assume you’re using “Add Movement Input”, and that is origin of the problem.

The solution is to: consume the input (Consume Movement Input Vector) and execute SetActorLocation in the next frame (Delay 0.0):

PS: this logic is in the pawn, so adapted it to your case.

1 Like

Thank you, worked that way!