SetWorldLocation launches Pawn into the air

Hello everybody,

I have been struggling with issue for a while:

I am doing a basic teleport system. The ideal case is that when the pawn overlaps with one of the portals, it would re-appear in the location of the other one.

I am using a Pawn blueprint derived from DefaultPawn. The issue is that when the pawn goes into either portal, it gets teleported to the other one but it is then launched into the air (a.k.a gains an immense amount of velocity). happens even if the destination location is any arbitrary location.

I tried different scenarios trying to isolate the problem. I noticed that the Pawn would teleport fine to any arbitrary location if I triggered it to teleport out of the OnComponentBeginOverlap execution.

I have been playing with the physics settings of all the objects involved and nothing seems to be solving my issue.

Any thoughts you may have on would be greatly appreciated.

P.S: is the basic teleport logic

Thanks,

Christian
www.chrisbegames.com

My guess would be that you shouldn’t set the world position of the CollisionComponent, but of the (Default?)SceneRoot component.
Everything else seems fine.

I’d agree with CrimsonHawk. I’ve ran into some strange issues trying to muck with the capsule component too.

I was using a teleport in one of my levels, and I did it by doing:

  • Cast to “My Character_BP” (or whatever)
  • drag off of “As My character_BP” on the Cast to node, let go and type in SetActorLocation
  • specify the “New Location” (in world coords) on the SetActorLocation node

That’s prolly one of a thousand ways to do it. hehe

Hey all,

Thanks for your attention on .

CrimsonHawk, I thought that could be the issue but the CollisionComponent is the root of the Blueprint. I tried to change it but it is inherited from the default pawn.

, I tried several different “SetLocation” nodes and still had the issue

The weird part as I mentioned in the original post is that setting the location in any other context (i.e Another function, BeginPlay execution,etc) works fine

Hey everybody,

So I managed to temporarily fix issue by using a different approach:

Teleportation is now handled by the Pawn instead of the portal. When OnComponentBeginOverlap is hit, I set a flag of the Pawn that would execute the teleportation code in the next tick. It is a workaround but works as intended.

My guess is that there is some sort of code or setting in the default pawn that is causing problem. I tried creating a new pawn and it worked perfectly with the blueprint I posted before. I may add a screenshot of the solution in a near future.

Thanks again,

Christian

1 Like