Player spinning around when colliding to walls

Hello community,
I want to make zero gravity system for my game. I made yet like a flying player with animation, but I have a problem if my character go sometimes against walls and corners:
If my charachter (when in zero gravity mode is) collides against a wall it spinns around.
Here a video to show it:
Click me to see the video
If you are a guy that doesn’t want to open links cause of fear of viruses and that stuff, here is the video file: robloxapp-20200529-1752013.wmv (4,9 MB)

I saw this doing the character when I play natural disaster. If I get hit by a part in my body falls down and it takes a second till I can get up. Here in this video I have the same problem.

I saw a video on a discord post in a server, where someone does the same thing like me, but he doesn’t spin like me. If he collides, his body react a part(no spinning, no flipping around, no moving). So I know, it is possible to prevent this problem.

I tried till now:

  • I searched on the internet for this problem… nothing found.
  • I disabled the player animation script when my animation is activated
  • I set my animation priority to maximum (“Action”)

Important thing I have to say: When the character moves, then he gets a “Bodyvelocity” inside every body part (I use R6). When he stops moving the “Bodyvelocity” get removed.

If you need any more information, be free to ask me!

PS: I hope I am in the right Category, because it is an scripting problem, but not directly…

I can’t really provide a good answer to this because I’m not really sure. Although, I think this might be to do with the humanoid state (I suspect the humanoid is put in a state that lets it get affected by physics).

You can change the humanoid state using Humanoid:ChangeState().
Humanoid | Documentation - Roblox Creator Hub

If that doesn’t work then maybe you could use a body gyro to keep the orientation in the way you want?

I’m not certain on the effectiveness of these methods, but maybe they give you a good starting point?

3 Likes

Thanks!
I never thought about to use bodygyro.
I try this two things, then I say if it works.

And thanks for this two starting points. :wink:

Thanks, the Humanoid:ChangeState helped me!

First I tried Humanoid:GetState
To see what states it does when spinning.
Then I set with Humanoid:SetStateEnabled FallDown to false and it worked.

I had this problem since weeks and now I don’t have it anymore! Thanks 123marble! :smile:

1 Like