I have a raycast car and I need the wheels to face the direction that the car is facing
as you see the wheels dont aligned with the way the car is facing
I tried using cframe but I cannot get it right
wheel.CFrame = CFrame.lookAt(wheel.Position, Vector3.new(carCFrame.LookVector.X, 0, 0))
I want the wheels to always like this
October 26, 2022, 7:57pm
I would probably tween a number value when the player left or right and use that to determine the direction of the wheels.
sorry if Its not clear, I double tapped space and it just posted my post when I wasn’t finished, anyway
I want all of the wheels to not spin around like they are in the vidoe, I just want them all facing the direction they should be facing, I tried using cframe to face them in the direction that the carbody is facing but it no worky
I want them to stay like this
I found how to do it, someone said in this post to get the angle you just get the cframe and then remove its position to only have the angle, heres it in code
local cfAngle = mainBody.CFrame - mainBody.Position
so with this code, ima able to keep the wheels facing the direction of the car’s body
Let’s say I have some arbitrary CFrame:
CFrame.new(0,0,0)*CFrame.Angles(math.pi/2, 0, 0)
How would I separate the position component from the angle component. For example I want this,
CFrame.Angles(math.pi/2, 0, 0)
and not this:
I’ve been stuck on this one for a while. Thanks!
November 10, 2022, 5:33am
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.