Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Spaccraft Controls [NEED HELP] How do you rotate the ship relative to the part rotated?

Asked by 6 years ago

I am confused about how I would go about rotating a part in local space. I want it to rotate local to its current rotation. If I can do so with body movers and without using a loop then I would love that. I am currently using UserInput to fire the rotation inside of a function as seen below.

local Config = require(script.Parent.ShipSeat.Configuration)

game.ReplicatedStorage.KeyDownEvent.OnServerEvent:connect(function(player,key)
    if player.Name == script.Parent.ShipSeat.ShipOwner.Value then
        if key == Config.keyconfig.Forward then

        elseif key == Config.keyconfig.Incline then

        elseif key == Config.keyconfig.RotLeft then

        end
    end
end)

game.ReplicatedStorage.KeyUpEvent.OnServerEvent:connect(function(player,key)
    if player.Name == script.Parent.ShipSeat.ShipOwner.Value then
        if key == Config.keyconfig.Forward then

        elseif key == Config.keyconfig.Incline then

        elseif key == Config.keyconfig.RotLeft then

        elseif key == Config.keyconfig.RotRight then

        end
    end
end)

whoever answers my question..Thanks in advance. :D

1 answer

Log in to vote
0
Answered by
blowup999 659 Moderation Voter
6 years ago
model.PrimaryPart = ThePartRotatingAround
model.SetPrimaryPartCFrame(CFrame.Angles(0,Math.rad(1),0) * model.PrimaryPart.CFrame)
0
Explain your answer in English. Don't just post code; this doesn't help the poster or the community understand why the code does what it does. hiimgoodpack 2009 — 6y
Ad

Answer this question