What do you want to achieve? Keep it simple and clear!
I am designing a helicopter system. I wanted to create a loosely realistic helicopter. I could not find a simple way to attenuate the velocity of the vehicle. VectorForces have no limits, and because I’m not familiar enough with Roblox, or physics calculations, I couldn’t implement a system for that from scratch to proportionally slow down the vehicle. So I scrapped that version.
I scaled the project back, to recreate a helicopter from a game on Roblox that I like: Heli Wars! They move at a constant rate in whatever direction you click, and the whole model’s orientation smoothly aligns itself to where you click on the screen over the next second or so from when you click.
What is the issue? Include screenshots / videos if possible!
I can’t figure out a simple way to align a vehicle’s orientation with a Mouse.Hit CFrame. I don’t want to use old Body Movers. However, the legacy systems seem to be soooo much more advanced than what is currently available. A BodyGyro seems like the perfect solution to my current problem. It is like AlignOrientation with an integrated PID controller. In older vehicles I’ve downloaded and tried from the marketplace, it works exactly as I want. I can hand it the Mouse.Hit and it will move smoothly. I can customize how aggressively it will turn, too. But it’s deprecated, so by my own rules and to keep up-to-date I can’t use it.
Maybe I’m hugely over-complicating the problem and don’t actually need a BodyGyro. Is there some way to replicate this behavior with constraints? Do I need to have a bunch of dummy blocks hanging off my vehicle or attached to the mouse somehow to recreate this behavior? I need exactly what a BodyGyro can do.
Just doing it with a torque or really three torques with their own PIDs would be way more complex for me, for what seems like no good reason. I’d have to pull in a PID system or create one myself and then create dummy invisible parts in my world to parent attachments to.
I am aware of PID modules that exist. The problem they are solving would not exist if the earlier system was not deprecated. This makes me wonder if there’s a simpler solution, or if I’m approaching the problem the wrong way. Why does the new solution require triple the complexity for the same task.
The problem isn’t the idea of a torque! I spent my afternoon trying to move the helicopter in forward, relative to its nose, no matter its orientation, with a LinearVelocity. I wanted to figure out if I was just wrong about how complicated a simple constraint for movement is. it did not work in any intuitive way. Vectorforces make more sense, but I can’t use those because I can’t constrain them. The heli pushed by linearvelocity would either move backwards or turn over on its side and go in circles or something confusing like that. I can’t see any reason why using a torque and PID or AlignOrientation would work out better. I can’t find any tutorials with these constraints being used for vehicles. I can’t even find a simple plane system in the marketplace that uses any of these new constraints to see what I’m doing wrong.
I could not figure out a way to control the velocity of an object pushed by a vector force. I tried to create a system that used a function to proportionally simulate like, air drag, but it did not work and made the vehicle fly in spirals and become unflyable. Limiting the AssemblyLinearVelocity worked, but was rough, caused the vehicle to stutter in the air, because it set a hard limit on how fast in any direction and any circumstance the vehicle would move.
You have to understand that a vectorforce will constantly apply a force to accelerate the object, if you don’t change the force quantity then it will accelerate infinitely. So you will have to get the current speed and if it’s over the speed limit then find the difference then apply the difference in the opposite direction.
I understand that. The problem is that it was not like, four vector forces pushing the helicopter forward and back and so on. It was one vector pushing from the bottom, and you’d tilt the helicopter to fly in that direction. Trying to work out where to apply the opposite force to stop acceleration was really complicated and I guess I just messed it up. However I implemented it was just broken and caused the vehicle to fly around in spirals, responding to its own response force and accelerating forever. I scrapped that version, it was too complicated for me to fix.
If you want to limit the velocity guaranteed then you can get the past velocity from a heartbeat frame and set the assemblylinearvelocity on a stepped frame but clamped to the max/min speed.
The problem with that way of solving it is that the object stutters when the velocity is reset, regardless of if it is done on a stepped frame or a heartbeat frame. I tried both, I tried this solution even.
I don’t think you understand. Simply setting it only on one specific type of frame will of course cause stuttering but
if you store the velocity from a heartbeat frame and use it on a stepped frame then it won’t.
I don’t understand. I did it exactly like you describe and it stutters.
local lastVel = nil
RS.Stepped:Connect(function(dt)
Thrust.Force = ThrottleSetting[ThrottlePtr]
if ThrottlePtr > 1 then
if lastVel.Magnitude > 75 then
local ResetALV = lastVel.Unit * 75
Base.AssemblyLinearVelocity = ResetALV
end
end
end)
RS.Heartbeat:Connect(function(dt)
if Seat.Occupant then
lastVel = Base.AssemblyLinearVelocity
if ThrottlePtr > 1 then
if Torque.Force ~= 0 then
Torque.Force = ResetAlongPlane(Torque.Force, Torque.Force.X, TorqueDrag)
end
if Tilt.Force ~= 0 then
Tilt.Force = ResetAlongPlane(Tilt.Force, Tilt.Force.X, TiltDrag)
end
if Nose.Force ~= 0 then
Nose.Force = ResetAlongPlane(Nose.Force, Nose.Force.Y, NoseDrag)
end
end
else
Thrust.Force = ThrottleSetting[1] -- if you get out, cut the throttle
end
end)```
oh then I may be wrong. I think this may be because vectorforces apply a constant force. If the force isn’t that high then it doesn’t stutter as much(less acceleration) .
That makes sense. It might be because the forces I’m applying are pretty strong.
I’m not really sure what to do with either of my systems now. It feels like a lot of wasted effort and I’m very confused and frustrated and not sure how to proceed with either completing the newer one that doesn’t use vectorforces or trying to make the vectorforces one work
Was the spiralling perhaps caused when the helicopter was turning? Because it could mean that there are excess forces on the X axis relative to the helicopter otherwise it’s too vague for me to understand.