- Home /
how to make a player with magnet like effects??
i have a platform and a sphere as a player...
wanted to create a cylindrical platform whereby the player sort of "sticks" on to the platform and moves freely...
||when the player is on the other side of the platform..||
2.the player is not affected by gravity but still snapped on to the platform..
what is the best solution for this problem??
any ideas or answers is appreciated...
thank you..
Answer by reptilebeats · Mar 29, 2012 at 04:21 AM
Manipulate the gravity in physics through scripting, so say i go though a trigger then gravity changes from y-9.3 to x-9.3 and vice versa. I dont know what the line is for accesing gravity but should be easy to find.
Or disable gravity and add a constant force to the character which changes pretty much the same thing. just only effecting that one object its on.
If you where going to eventually use a human character u would also have to apply rotation
So x = -9.3 and transform.rotate 90
Oh u could get fancy and make the force relative to the players feet pointing down so where ever he walks the gravity is always down
Answer by jpivarski · Aug 09, 2012 at 08:30 PM
This is a different suggestion, so I'm putting it in a different Answer. There's a question here about walking on walls with magnetic boots. There are many detailed solutions that force the character to be upright and aligned with the surface by hand, rather than designing a physical scenario that would give rise to it. The latter might be more stable, just as a real pair of magnetic boots wouldn't be 100% fault tolerant. It depends on what you want.
Your answer
Follow this Question
Related Questions
my ball sometimes jumps higher or sometimes not 2 Answers
Particle system turns on when player gets close. 1 Answer
AI follows player between platforms in 2D? 1 Answer
Player parent to platform problem 0 Answers
2d platformer player shoots 1 Answer