gravity making me mad

i want the capsule to jump on other object too and rotate in all the direction just like its working with capsule.can anyone tell me whats the problem? how i write switch so it can write can anyone provide switch?

here is the code

821388--30421--$Untitled.png
822493–30496–$faux gravity.rar (160 KB)

i really need help

not sure i get what you mean , but if your using rigidbodies, have you tried using the Constraints?

Well since I have asked two questions this month, i suppose I should try to answer one :). I will have a look.

capsule is stick with the sphere using the gravity like in mario galaxy but its not jumping in other objects :s i want it to jump on other object too and when it jump gravity switch to other object to whom character is came

The problem is that the ball is the only magnetic force physics wise and in code you never change that. So when you jump the force always pulls you back to the ball. Since you have overriden certain physics, even turning gravity off doesn’t change the magnet.

I think what you want to do is base the strength of the magnetic force based on the proximity of the player. So when you jump the strongest force pulls you to that object. Or alternitivly turn off all magnetic forces in the jump and let gravity do its work until you collide with something, when you do the magnetic force turns on. So another words as long as your touching something magnets for what your touching are on, when you arent touching anything everything is off until you do. Than use gavity. however you are going to have to know whats up or down, so you’ll have to create a weight of the player based on his facing (up and down) direction. Which is a bit over my head but I would start with setting up the magnets to turn on and off using collision.

well i try what you said you try too if you can make the logic correctly let me know

need help

Show us some effort, and we will help.

check the first post and attachments

Why not put a trigger collider around each object that activates it’s gravity when you enter it and deactivates it’s gravity when you enter another one.

i tried a lot of methods but didn’t get the result that’s why i put my project in attachment if anyone download and try to fix it i would be extremely helpful