(solved) AngularVelocity of a Hinge doesnt change through script

  1. What do you want to achieve? Keep it simple and clear!
    I am making a tank. I want to make it turn left and right.

  2. What is the issue?
    Whenever VehicleSeat.Steer changes, it should change the AngularVelocity of Hinges on my wheels, but it looks like script just ignores changing the property. Other parts of script are functional.

  3. What solutions have you tried so far?
    I tried changing ActuatorType to Motor, Servo
    I separated strokes into 2 scripts, sometimes tank can turn sideways, sometimes it only can go forward and reverse.

	if script.Parent.Steer == 1 then
		tank.L1.AngularVelocity = turnspeed
		tank.L2.AngularVelocity = turnspeed
		tank.L3.AngularVelocity = turnspeed
		tank.L4.AngularVelocity = turnspeed
		tank.L5.AngularVelocity = turnspeed
		tank.L1S.AngularVelocity = turnspeed
		tank.L5S.AngularVelocity = turnspeed
		tank.L1.AngularVelocity = turnspeed
		tank.L2.AngularVelocity = turnspeed
		tank.L3.AngularVelocity = turnspeed
		tank.L4.AngularVelocity = turnspeed
		tank.L5.AngularVelocity = turnspeed
		tank.L1S.AngularVelocity = turnspeed
		tank.L5S.AngularVelocity = turnspeed
       --print(script.Parent.Steer)
		tank.R1.AngularVelocity = turnspeed
		tank.R2.AngularVelocity = turnspeed
		tank.R3.AngularVelocity = turnspeed
		tank.R4.AngularVelocity = turnspeed
		tank.R5.AngularVelocity = turnspeed
		tank.R1S.AngularVelocity = turnspeed
		tank.R5S.AngularVelocity = turnspeed

What is outside the code you’ve just shown? Is it in a while loop, a heartbeat connection or a function?

Also:
Holy spaghetti.
Try using :GetChildren() and iterating through that instead of… copy and pasting like that.

1 Like

hello thanks for responding, i already solved it, i will close this post soon
but still ty for atleast responding

please say how you solved your issue then mark that as a solution. it’s very painful for someone having an exact issue then just finding “I fixed it!”

I dont know why it worked but:
The code i shown was first in the “if occupant ~= nil then” so it didnt work for some reason. When i cut code with Steer and pasted it latest in occupant checker it worked

if occupant ~= nil then
if Throttle = 1 then
if Steer = 1 then
end ```

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.