Gravity to a certain point?

RocketBrainRocketBrain 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

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited March 2016

    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

  • RocketBrainRocketBrain Member, PRO Posts: 269

    Yeah I've used that but it creates a more direct line rather then a spiral in to that point.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    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.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited March 2016

    @RocketBrain said:
    Yeah I've used that but it creates a more direct line rather then a spiral in to that point.

    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

Sign In or Register to comment.