How to teleport Vehicle Player Pawn?
I tried using the Get Player Pawn > Teleport (binded to a key event). The Vehicle didn't want to teleport to the designated location. It pretty much do nothing. Is there anything special needed for telporting Vehicle Pawn? I believe this action works in 4.1 on standard FPS pawn.
Thanks in advance.
asked Jul 13 '14 at 08:21 AM in Blueprint Scripting
I ran into the same issue and the basics of the issue is that the physics body on the skeletal mesh needs to be teleported along with the actor itself.
I am not sure if you are just using blueprints or also are adding c++. We use c++ and wrote a teleport function to our vehicle which does the following:
Calls StopMovementImmediately on the movement component
If you are using blueprints only I dont see anywhere this stuff is accessible. If you do have any C++ I recommend you either add a new blueprint function which does the same on your vehicle c++ class OR add a static function to your blueprint library c++ class.
Alternatively you could continue to use the teleport blueprint function on your actor, and in your c++ dervied vehicle class override virtual void TeleportSucceeded(bool bIsATest) (from AActor) and call the three functions listed above.
The real function which does the actual teleport is void FBodyInstance::SetBodyTransform(const FTransform& NewTransform, bool bTeleport). As long as your provide true to the second param, the body is then teleported without physics.
Hope this helps
I have been having a very similar issue with something I have been working. I have found somewhat of a workaround, however this only works server-side so far, and not for clients. I'll put it simply.
Disable physics > Delay > Teleport > Delay > Enable physics
I have found that this does work for my vehicle pawn, however it only works for the server. Clients seem to jump to the destination, then back to where they were. I'm still working on it, but it should be enough to get the ball rolling.
answered Sep 20 '14 at 10:47 AM
I tried this and notice it worked fine unless you are doing multiplayer screens or running the play option with dedicated server in which case I think it needs some replication.
If you are wanting to make this work in multiplayer just create a CustomEvent and under replication make it Run On Server and check Reliable(which gives it a high priority). Drag off the Keybind and then type in the name of your custom event which should create a blue version of it.
Then add your custom event and connect it to teleport. I would change the Get Player Index to Get Reference to Self so that you don't teleport other players around.
Ok I gave up on teleporting my car using teleport / set location function. It's completely non working for vehicle pawn. So I decided to just destroy the actor and reposses it. This doesn't solve the fundamental problems, but at least gets me to where I want for now. I really hope somebody knows the answer on why I can't use standard teleport for vehicle pawn. I've double checked the teleport and confirmed it that on the same project with a regular character pawn teleport worked.
answered Jul 15 '14 at 06:19 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here