AssemblyAngularVelocity can't be assigned to AssemblyLinearVelocities value

I have the weirdest issue right now. I basically have a cannon with wheels that are attached to a hinge constraint (Unanchored and CanCollide off). When I assign AssemblyAngularVelocity to a value directly in studio, it works fine. When I assign it to something like (5,0,5) in a script, it works fine! BUT for some reason when I assign it to AssemblyLinearVelocity via script, it won’t work??? And the weirdest thing about all of this when I assign it to AssemblyLinearVelocities value via studio it works… Is this a bug or am I going crazy?

2 Likes

What is your code? Can you send it here please?

2 Likes

literally

while wait() do
    script.Parent.AssemblyAngularVelocity = script.Parent.AssemblyLinearVelocity
end
1 Like

The reason will be is because you’re making the linearvelocity stay the same as it already is. But maybe you wrote the code wrong here because you did mention above (5,05)

Try

while wait() do
    script.Parent.AssemblyAngularVelocity = script.Parent.AssemblyLinearVelocity + Vector3.new(5,0,5)
end

Yea that works, but still not what I want. I’m convinced this is a bug at this point because there are no errors and theoretically it should work.

What exactly did you want? Please explain.

For AssemblyAngularVelocity to be set to AssemblyLinearVelocity

I got you now.

First off, is the LinearVelocity actually a value or is it 0, 0, 0?

SOLUTION FOUND! I think the main issue was that the hinge constraint was making it to where the 2 forces were cancelling each other out or something. I’m not sure why this fixed it but it did:

while wait() do
    script.Parent.AssemblyAngularVelocity = Vector3.new(-script.Parent.AssemblyLinearVelocity.X,0,0)
end

I’m not sure why either but congrats!

Nevermind, false alarm. Still doesn’t work :stuck_out_tongue:

Oof!

Is the LinearVelocity property actually anything or does it change or is it always the same or always 0, 0, 0?

Just set to 0,0,0. Its so weird though. it only works when I set 1 of the 3 values. When I set the X, only the X works, when I set the Z, only the Z works, but when I do both, the game craps itself

Setup:

image

If LinearVelocity is always 0, 0, 0 then this code might work:

while wait() do
   script.Parent.AssemblyAngularVelocity = Vector3.new(5,0,5)
end

Well, problem is, I don’t want to set it to 5,0,5. I want it to set to AssemblyLinearVelocity. I just set it to that just to test it

while wait() do
    script.Parent:ApplyAngularImpulse(script.Parent.AssemblyLinearVelocity)
end

I dont think it will change much but still u can try

Is LinearVelocity always going to be 0, 0, 0? If it will always be 0, 0, 0 then the code below would work

while wait() do
   script.Parent.AssemblyAngularVelocity = Vector3.new(0,0,0)
end

Or does the LinearVelocity change?

No bro, Linear velocity will change as the cannon is on wheels and moves around.

Same result. :confused:. Like I said, convinced this is a bug. If you guys want I can send you the model