How do I change the orientation in the cframe only? on Alignorientation
You have to use CFrame.Angles
, sorry for the misinformation earlier.
Code:
AlignOrientation.CFrame = CFrame.Angles(math.rad(20), 0, 0)
It keeps going to 0,90,0 even though this is script:
if VehicleSeat.Steer == -1 then
AlignOrientation.CFrame = CFrame.Angles(0,math.rad(45),0)
MainLinearVelocity.VectorVelocity = Vector3.new(MainLinearVelocity.VectorVelocity.X,MainLinearVelocity.VectorVelocity.Y,-MaxLinearVelocity)
elseif VehicleSeat.Steer == 1 then
AlignOrientation.CFrame = CFrame.Angles(0,math.rad(-45),0)
MainLinearVelocity.VectorVelocity = Vector3.new(MainLinearVelocity.VectorVelocity.X,MainLinearVelocity.VectorVelocity.Y,MaxLinearVelocity)
elseif VehicleSeat.Steer == 0 then
AlignOrientation.CFrame = CFrame.Angles(0,math.rad(0),0)
MainLinearVelocity.VectorVelocity = Vector3.new(MainLinearVelocity.VectorVelocity.X,MainLinearVelocity.VectorVelocity.Y,0)
end
What did you set the Responsiveness and MaxForce too? Could you also send a video?
When it rotates is when I change rotation with studio, then when it goes back thatās when I steer
Where to start is easier than ever in Roblox. There are many premade designs of whatever youāre looking for in most cases. Even though Iām a big fan of doing it all my way. Sneak peeking at previous designs is a gift that is hard to pass up. Always seem to find something close to what I want to do and with some re-editing can get it to work out. Also, Iāve seen some pretty sweet helicopters in the toolbox models.
I need to go to sleep now, but just keep testing different values on the AlignOrientation, your responsiveness may be too low. Make sure to watch the tutorials I sent.
Iām making this helicopter not with free models and I canāt understand other peoples code or too lazy to read it
I got it to turn when steer changes now I just have to implement constant rotation
IT WORKS it can now turn the whole body and steer correctly without align orientation idk if I would have ever got this done
I used a loop
while task.wait() do
if VehicleSeat.Steer ~= 0 then
AlignOrientation.CFrame *= CFrame.Angles(AlignOrientation.CFrame.Rotation.X,-script.Parent.Steer/50,AlignOrientation.CFrame.Rotation.Z)
end
end
it may be inefficient but at least it works
I would recommend using ātask.waitā instead of āwaitā due to wait being older and laggier.
Good work, Iām actually impressed you learnt all of this so quickly. To improve your loop, you should just use task.wait() without any numbers so it updates every frame, it will be way smoother without a noticeable performance difference.
If you would like to, I would love to see a video of the helicopter.
Here is video of helicopter:
It may not be realistic, but it works
I tried to use task.wait() but it was going too fast so it would rotate the whole thing causing the helicopter to not steer so I just used .1
Just make it divided by 100 instead of 10 then. It would be more responsive.
Code:
while task.wait() do -- changed to tas k wait
if VehicleSeat.Steer ~= 0 then
AlignOrientation.CFrame *= CFrame.Angles(0, script.Parent.Steer/100, 0)
end
end
Also, to make it look more realistic, you can make the helicopter tilt forward and backward when moving by setting the AlignOrientationās CFrame.
I did try to make the helicopter tilt, but since the CFrame is not dependent on its own axis, itās hard to implement that kind of system and it was buggy, I also updated it with the more responsive code
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.