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.
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.
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
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.