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?
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.
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