Why is he spinning like that

Hi all,

I’m currently working on NPC thieves for a GTA-style game. They spawn inside buildings every few minutes. Cops must either kill them or arrest them. I use both AlignPosition and AlignOrientation for the arrest system.

These are the properties I apply for the AlignOrientation on the criminal.

local AO = Instance.new("AlignOrientation")
AO.Parent = criminalCharacter.HumanoidRootPart
AO.Name = "ArrestForce"
AO.Attachment0 = criminalChar.HumanoidRootPart.RootRigAttachment
AO.Mode = Enum.OrientationAlignmentMode.OneAttachment
AO.MaxTorque = math.huge
AO.PrimaryAxisOnly = true
AO.MaxAngularVelocity = 50
AO.Responsiveness = 200
AO.CFrame = copPlayer.Character.HumanoidRootPart.CFrame

This is what happens:

How can I make sure the character doesn’t spin like that? Could it be because PlatformStand of the character was enabled (after I tased the thief)?

Thanks in advance.

6 Likes

show a video of how the character is spinning

did you press play on the video?

It turns out that was the issue. I had to set this to false. Now it works fine.


(video might be laggy)

1 Like

After looking into it,

  • The spinning issue could indeed be due to the PlatformStand property being enabled. When PlatformStand is enabled, the thief’s Humanoid attempts to keep himself upright, which could conflict with the AlignOrientation constraint and cause the spinning.

  • Another potential issue could be the MaxAngularVelocity property. A value of 50 might be too high, causing the character to rotate too quickly.

  • Lastly, you might want to check the PrimaryAxisOnly property. If it’s set to true, the AlignOrientation constraint will only apply torque when the primary axes become misaligned. If you want the character to align more accurately with the cop player’s orientation, you might want to set PrimaryAxisOnly to false and change the MaxAngularVelocity to 10 (Adjust as needed).

2 Likes

shoot, just finished my whole paragraph and didn’t see this…

1 Like

Your paragraph is very insightful and it also contains the solution, so I’ll mark your reply as a solution as it may be easier for people reading this thread to understand

1 Like

the video isn’t attached to the post

I’m guessing it’s an issue with your browser or something, because I did attach the video in the original post.

I use chrome, and the only extensions I have is Stylus [for DevForumPlus]

though I was able to view it in Incognito

1 Like

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