GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Make Actor Immune to Gravity

tjsumpthuntjsumpthun Posts: 2Member
I have an actor that is a platform controlled by the player. The platform moves fine when Gravity is OFF, but when it is ON the platform falls away into nowhere. I need gravity to apply to every other actor except for the platform.

Comments

  • doufaya66doufaya66 Posts: 2Member, PRO

    hello,

    I have a scene where the gravity Y is ON , however i had an specific actor who need to move freely on Y axe but it cant cause of the gravity, i do need the gravity Y to stay ON as well.

    My question is can i make an actor immune to gravity ?

    thank you very much for your time and help .

  • RowdyPantsRowdyPants Posts: 403Member, PRO

    @doufaya66 There are a couple of ways to do gravity in GameSalad. If you want a global gravity you can use Scenes > Scene > Attributes > Gravity. You can even change it during the game. To change it you'll need to create an instance of an actor in the scene and unlock it (just put an actor in the scene, click into it, and unlock that instance from its prototype). It will then be able to access and change scene properties and even properties of other actors in the scene. This is usually done on a master controller type actor that is unlocked to control game states and global things like this.

    If you just want certain actors to have gravity you can individually give them a downward (angle of 270) acceleration with an accelerate behavior. Moving an actor with the accelerate behavior, move behavior, or move to behavior requires that the actor have Physics > Movable checked. However, you can also use the interpolate behavior to move the actor around without needing Physics > Movable checked. Remember that interpolation always overrides the other movement behaviors and collision behavior.

  • Two.ETwo.E Posts: 437Member, BASIC

    Hello,

    I would say a potential solution is to ignore the Game.Gravity and to apply "Gravity" to all actors that need to be affected by this.

    To do this, simply add an acceleration behaviour with the direction to 270 (downwards) relative to scene. Or which ever direction you wish. The speed is the "Density" of gravity. You then copy this to all actors that need gravity.

    (Alternatively, you can create a game.attribute (real), and use this as the speed value. This way you can change all behaviours speed value at once.)

    This way, the actor that doesn't need to be affected by gravity doesn't have an acceleration behaviour added to it.

    Hope that helps.

    Best,
    Two.E

  • doufaya66doufaya66 Posts: 2Member, PRO

    yes its helps ill go for that , thank you

Sign In or Register to comment.