Gravity to a certain point?
RocketBrain
Member, PRO Posts: 269
I see we can change the gravity up, down, and sideways but is there a way to cause a gravitational pull toward a certain point? Similar to a blackhole.
Comments
Don't use the scene gravity. Instead, put an "accelerate" or "accelerate towards" behavior in each actor that you want to be affected by gravity. In the behavior you can set the coordinates to where you want the point of gravity to be.
I never use the scene gravity, because the accelerate behavior gives you much more flexibility. For example, you can have different actors have different gravity force.
Mental Donkey Games
Website - Facebook - Twitter
Yeah I've used that but it creates a more direct line rather then a spiral in to that point.
you want to use vectortoangle to get the angle, and magnitude to adjust the speed. I was able to get a pretty good spiral in my game A Long Way Home.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
If there is no other force applied to the actor, it will accelerate straight to the point of gravity. Try adding a little velocity ("change velocity") to the actor, and you'll see it spiral to the point.
Mental Donkey Games
Website - Facebook - Twitter