Walvolin
(Walvolin)
September 14, 2022, 8:21am
#1
Hello, I have made this part that moves forward with a prompt and linearvelocity, and cannot find any posts relevant to what i’m trying to do.
What would I do for this part to make is turn left and right with a vehicle seat? Would I have to use linearvelocity again? What would I use inside the code?
Thank you in advance for any help.
1 Like
Valkyrop
(JustAGuy)
September 14, 2022, 11:42am
#2
Maybe the following threads would help:
Try this.
(Part.CFrame * CFrame.Angles(math.pi/2, 0, 0)).LookVector
Important things to know:
math.pi/2 represents 90 degrees
If the lookvector turned in the wrong direction, move the ‘math.pi/2’ to another position in the CFrame.Angles value
If the lookvector turned the opposite direction to your likings, put a subtraction sign (-) in front of the ‘math.pi/2’ like so:
(Part.CFrame * CFrame.Angles(-math.pi/2, 0, 0)).LookVector
To transform a CFrame in object space multiply it by another CFrame.
char:SetPrimaryPartCFrame(RootPart.CFrame * CFrame.new(-8, 0, 0))
This should put ‘char’ 8 studs to the left of ‘RootPart’ regardless of it’s rotation.
1 Like
Walvolin
(Walvolin)
September 14, 2022, 5:17pm
#3
I’m not quite sure how these would be applicable to what i’m trying to do, but that may be becuase of my lack of coding knowledge
1 Like