Backward vector is fixed at X=-1, Y=0, Z=0

Hello All !
I’m trying to follow this tuto : Skateboard tuto

I have a little problem that I can’t solve: when I want to move backwards (S key), the skateboard does not go in the current direction (normaly backward vector, opposite of forward vector). But, the forward vector returned is always like X=1, Y=0, Z=0 (I have no more controls on the rotation when I move backward). It’s strange…
I can rotate my character when I move forward but I cannot when I move backward with this code.

My Character is the ThirdPersonCharacter from the template and I have added a SkeletonMesh (the Snowboard) under the character.
image

Hope someone could help me.

Thank you in advance !

When the snowboard rotates, are you rotating just the snowboard mesh or the entire actor? If it’s the latter, you want GetActorForwardVector instead. The forward vector of the mesh is relative to the actor that owns it so if it never rotates within the owning actor, its forward vector is always +X.

1 Like

Thanks @JaredTherriault for the rapid answer.

I would rotate the entire actor.

I have already try the GetActorForwardVector :frowning: without success

Is your actor rotating at all?

Yes, when I move my actor forward, I can rotate (keys W+D or W+A).
When I don’t move, I can rotate too (D or A keys).

When I move backward, the character move along the -X axis only. I can not rotate anymore.
Here is my code for rotation:

Here you will find some print of the Forward Vector, when I press S key (backward key) (the axis value is -1 in that case).
X=0.998 Y=0.065 Z=0.000
X=1.000 Y=-0.008 Z=0.000
X=0.998 Y=0.065 Z=0.000
X=1.000 Y=-0.008 Z=0.000
X=0.998 Y=0.065 Z=0.000
X=1.000 Y=-0.008 Z=0.000
X=0.998 Y=0.065 Z=0.000
X=1.000 Y=-0.008 Z=0.000
X=0.998 Y=0.065 Z=0.000

At which point in your code are you printing this? I just want to try to figure out if the vector is being affected by any other code

Sure, I wrote the print here:

I found the solution ! Finally, I had to spend 2 hours … ouch ouch ouch :slight_smile:

We must uncheck Orient rotation to movement in the Character Movement Component and check Use controller rotation yaw in the Character Class Defaults panel.
Also, I have to make some adjustment in the Right Event : replacing Add Movement Input by Add Controller Yaw Input.

Thanks @JaredTherriault for the help ! :slight_smile: