• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Physics Rotation and Collision

F

Flo_R

Guest
Can someone tell me why the physics are so weird and how i can fix it?

ezgif.com-crop (1).gif
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
You must be changing angle of the object directly (phy_rotation) instead of changing it's angular velocity (phy_angular_velocity).
 

Bingdom

Googledom
I don't have much experience with physics, but ensure that linear dampening is at a small value, maybe try 0.01?
 

chance

predictably random
Forum Staff
Moderator
Can someone tell me why the physics are so weird and how i can fix it?
Describe what you are trying to do, and what the problem is. Verbally. (The animation isn't as useful, because I can't tell whether there are physics issues, or animation artifacts.)
 
F

Flo_R

Guest
Describe what you are trying to do, and what the problem is. Verbally. (The animation isn't as useful, because I can't tell whether there are physics issues, or animation artifacts.)
i want the Ball to fly away. In the Animation you can see that the ball is kinda stuck.
 

chance

predictably random
Forum Staff
Moderator
Depending on the relative masses (densities) of the ball and stick, the ball may be behaving correctly... or not. Is the stick a kinematic object? Is so, that's a potential problem. Forced movement of kinematic objects don't interact properly in collisions.

Also, rather than specifying a rotation, try moving the stick with a small applied torque. You can dampen the angular motion to prevent runaway.

- try reducing the friction between the ball and stick.
- try giving the ball a larger coeff. of restitution (closer to 1).
- try making the stick more massive (higher density) than the ball.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
i am changing the phy_rotation by +=3
As I have said, that is not how the issue should be approached.
Changing phy_rotation directly "snaps" the object to new rotation. It does not "gradually" rotate, does not have angular velocity this way, and thus can "miss" objects or cause them to behave unexpectedly (as it suddenly starts overlapping them).

Should be doing something like phy_angular_velocity = 3 * room_speed;
 
F

Flo_R

Guest
As I have said, that is not how the issue should be approached.
Changing phy_rotation directly "snaps" the object to new rotation. It does not "gradually" rotate, does not have angular velocity this way, and thus can "miss" objects or cause them to behave unexpectedly (as it suddenly starts overlapping them).

Should be doing something like phy_angular_velocity = 3 * room_speed;
Thank you very much it worked
 
Top