Try printing the values and let me know what it prints.
Try printing the LinearVelocity and AngularVelocity
Try printing the values and let me know what it prints.
Try printing the LinearVelocity and AngularVelocity
also why u try to set 0 to 0?
script.Parent.AssemblyAngularVelocity = script.Parent.AssemblyLinearVelocity
So I think when the cannon moves the velocity changes so it wonât be 0, 0, 0
The cannon is moving. Linear Velocity is not 0!!!
If you guys want it
while wait() do
script.Parent.AssemblyAngularVelocity = script.Parent.Velocity * 100
end
Already tried that, also doesnât workâŚ
Then use hinge constraint fot this
There is a very complicated reason why I canât do this but trust me I canât rely on just purely a hinge constraint. there already is one ofcourse
As a sidenote, using while wait() do is bad practice.
Wait() in general is deprecated, as it doesnât work well with the way the engine runs things. Itâs also better to include the delay/yield in the script itself, so you would get:
while true do
doStuff()
task.wait()
Or with the task.wait() coming before doing something in case it can error and otherwise could error without delay.
while wait() do
script.Parent.AssemblyAngularVelocity = Vector3.new(script.Parent.Velocity.X + script.Parent.Velocity.Z * 100,0,0)
end
This gave me an Idea and it worked. I have absolutely zero Idea how this solution worked, but It did. Thank you everyone for helping!
while wait() do
script.Parent.AssemblyAngularVelocity = Vector3.new((script.Parent.Velocity.X - script.Parent.Velocity.Z)/-2,0,(script.Parent.Velocity.X + script.Parent.Velocity.Z)/-2)
end
Ur cannon is moving in X and Z axes so sometimes velocity will be 0 for x but 10 for z
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.