How to get the vehicle's world locatioin?

When I drive the tank around the map, I see that tank is moving quite well. But whenever I get a world location of the Actor or the Mesh, which I can see is moving around, I get the same location on the map where it started from. But I get the correct world location for the the Seat, an Actor Component that is literally attached to the Mesh (the character is attached to the Seat).

image

The Mesh is the root component. You can see in the screen shot below that the Mesh world location never changes as I drive around, but the Seat’s world location does. The print is done in Tick and I show which nodes I am using to pull the data from the Mesh and the Seat.

I am really at a loss at this moment to know how to discover where in the world the tank is located on the map.

What am I doing wrong???

BTW, I know I can just use the location of the Seat and all, but I am still at a loss to understand why the Mesh’s world location is never changing. If I didn’t have Seats, how would I discover the Mesh’s location as it moved?

Can you just try plugging the mesh location directly into the print node ( without formatting )?

That was what I did initially, I expanded the print to include part of the skeleton’s location side by side to show that they don’t match.

I am now thinking that the Chaos Vehicle Movement Component literally moves the mesh’s skeletal root bone and not the Mesh Component nor Actor. I am thinking it may be using root motion animation exclusively. If that is the case, I wish that Epic would have noted it in the documentation somewhere. But if that is the case, I am a bit confused why they would do that, since they would also need to move the colliders with the skeleton.

I am going to dive deeper into this to confirm if this might be the case.

1 Like

It sounds like you’re right :thinking:

You might find this interesting…

I have the tank spawn on the side of a hill so that it rolls backwards by physics naturally. This is what I expect. But what I didn’t expect is that the camera’s spring arm doesn’t move with the vehicle unless I pin it to the Root bone.

I am sure they had good reason for doing what they did for high performance, but it has a truly defying intuitive design.

EDIT: I got the CVMC to replicate all the movement of the tank I needed. The last piece was to turn the vehicle on its root, which was done with the Set Yaw Input. To get this to work, I needed to setup the Arcade Torque settings.