Okay, so what I have right now is a hovercraft that uses "thrusters" that can swivel to provide movement going forwards/backwards and in turning. Here is the current script I use for controlling these constraints, which is placed inside a VehicleSeat.
local frontleft = script.Parent.Parent.FL.FL -- Front Left Thruster
local backleft = script.Parent.Parent.BL.FL -- Back left thruster, etc. etc.
local backright = script.Parent.Parent.BR.FL
local frontright = script.Parent.Parent.FR.FL
while true do -- Steering and Fowards/Back Controls
wait()
if script.Parent.Throttle == 1 then
frontleft.move.TargetAngle = 45
backleft.move.TargetAngle = 45
backright.move.TargetAngle = -45
frontright.move.TargetAngle = -45
end
if script.Parent.Throttle == 0 then
frontleft.move.TargetAngle = 0
backleft.move.TargetAngle = 0
backright.move.TargetAngle = 0
frontright.move.TargetAngle = 0
end
if script.Parent.Throttle == -1 then
frontleft.move.TargetAngle = -45
backleft.move.TargetAngle = -45
backright.move.TargetAngle = 45
frontright.move.TargetAngle = 45
end
if script.Parent.Steer == 1 then
frontleft.steer.TargetAngle = -20
backleft.steer.TargetAngle = 20
backright.steer.TargetAngle = -20
frontright.steer.TargetAngle = 20
end
if script.Parent.Steer == 0 then
frontleft.steer.TargetAngle = 0
backleft.steer.TargetAngle = 0
backright.steer.TargetAngle = 0
frontright.steer.TargetAngle = 0
end
if script.Parent.Steer == -1 then
frontleft.steer.TargetAngle = 20
backleft.steer.TargetAngle = -20
backright.steer.TargetAngle = 20
frontright.steer.TargetAngle = -20
end
end
What I want to do is use the Q and E keys to make the thrusters face to the side and provide sideways thrust (basically strafing). I tried looking at the Wiki article for ContextActionService, but I don't know how to apply it to what I am doing. I am still a somewhat noob to scripting, but any help is appreciated. Thanks in advance, -legolegolego456
