Can you change the build-in gravity attribute when you're in game?

FreiGamesFreiGames Member Posts: 158
edited November -1 in Working with GS (Mac)
As title says.

I need this to make the player able change the gravity of some particles when he/she is in game, and you can only affect particles with the build in gravity attribute, right?

Thanks!

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I'm not sure what you saying. You can affect scene gravity with an instance of the actor once it is placed in the scnene but not sure about only affecting particles
  • FreiGamesFreiGames Member Posts: 158
    tenrdrmer said:
    I'm not sure what you saying. You can affect scene gravity with an instance of the actor once it is placed in the scnene but not sure about only affecting particles

    What I'm saying is, that there is a built-in gravity attribute in GS, and basically I want to change this while my game is running.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    FreiGames said:
    What I'm saying is, that there is a built-in gravity attribute in GS, and basically I want to change this while my game is running.

    yes you can. What you need to do is drag the actor onto the scene and double click it to unlock it like tenrdrmer said to gain access to the actual gravity attribute since its a scene attribute. Not sure the would be your best bet though, since everything in the level will be affected by gravity. You can put a attributes into the direction and speed for the particles, and then change that attribute on the fly whenever you want the particles to change. THat might work better for you
  • butterbeanbutterbean Member Posts: 4,315
    What I would recommend instead of using the in game gravity, is to place gravity on an actor using "Accelerate down"

    You can create an integer attribute called "player gravity" in the player as a local attribute.

    Let's just say it's 300

    Then in the player, use the "accelerate" attribute, and make it go down (direction 270)

    Then under speed, select the attribute that way it coordinates with that attribute and it's set number.

    Then within the actor, you can change the gravity at anytime and it will affect the acceleration.

    Hope this helps!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can change that but it will affect all movable actors in the scene. The only way to access it it though is by unlocking an instance of an actor that has been placed in the scene and seting up your rules there.

    If it is a rule you will need over an over in other actors or instances of actors you can take the rule you have made in your unlock instance and drag it to my behaviors. be sure to name it so you know what it is before dragging to my behaviors. Once there you can go back to the prototype and drag over the custom behavior to your prototype actor. any scene attributes in the rules will look messed up but once you place it in a scene it will fix it self.

    One last note. be sure you save a backup before trying this 0.9.0 had a bug where this messed up the project, but codemonkey said it should have been fixed with 0.9.1 update.

    Good luck I hope that helps
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    woo a race! ;)
  • FreiGamesFreiGames Member Posts: 158
    Thank you everyone, I figured out how to do it!
    ButterBeans, yeah that's what I usually do, though I NEED to use the built-in attribute since it needs to affect particles, and that can only be done with that attribute, but thanks for the reply anyways. :D
Sign In or Register to comment.