How to combine two rotated forces together?

I have a custom hoverboard movement system, and due to the nature of the players rotation on the board, I have to account for it in my movement. Originally, I had the two forces together, but the z force needs to match the rotation of the player, while the x force can’t be. Here is where the two forces are ajusted.

local forceDirection = camera.CFrame.LookVector
forceDirection = forceDirection*speed
		
forceZ.Force = Vector3.new(0, 0, math.abs(forceDirection.Z))
forceX.Force = Vector3.new(math.abs(forceDirection.X),0,0)

And remember the z force is rotated 90 degrees, so I cant just put them together traditionally. Does anyone have any ideas?

1 Like

It’s not really clear what you are trying to achieve, but if you want make a Vector3 relative to the character you can just apply the character’s rotation:

forceZ.Force = playerCharacter.HumanoidRootPart.CFrame.Rotation * Vector3.new(0, 0, math.abs(forceDirection.Z))

Thanks for the reply but I ended up figuring it out anyways. I wanted to combine them to avoid extra speed traveling diagonally, but I just ended up getting the multiplier from the look vector to cancel it out. Also ended up using a pid controller to smooth out the movement.