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.
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.
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
I found the solution ! Finally, I had to spend 2 hours … ouch ouch ouch
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.