External Forces (Wind for Example)?

richcoyrichcoy Member Posts: 211
edited April 2012 in Working with GS (Mac)
If you want to have something act like a fan, blowing your character slightly off course when they cross its path, how would this be accomplished? This could also be a current in a river, as another example.

I'm thinking that there would be an invisible actor representing the path of the air but don't know what rules make it look like it's pushing on the actor. Is there a demo of something like this implemented?

Thanks.

Rich

Best Answer

  • aarioaario Posts: 256
    edited April 2012 Accepted Answer
    when actor.1 overlaps/collides with wind.1-->move

    then you can set the direction and the speed of the move equal to global attributes

    you can go even further by having the wind actor change those global attributes when it comes in contact with your actor.1

    -- For Example --

    when wind.1 overlaps/collides with actor.1
    -->change attribute wind.Direction to self.Rotation
    -->change attribute wind.Speed to random(value.1,value.2)

    Hope that helps,
    aario

Answers

  • richcoyrichcoy Member Posts: 211
    So if I understand your first example above, gravity acting on my player actor would be a global variable and when there is a collision with the wind I would adjust the global gravity variable accordingly. Part of my difficulty in understanding this is that this is a top-down game so there is no gravity affecting the player until I want to push them left right up or down.

    Thanks for the tips.
  • MotherHooseMotherHoose Member Posts: 2,456
    @richcoy … your thinking the right direction!

    www.stormystudio.com … has a GS template for paperToss with a fan blowing

    image MH
  • aarioaario Member, PRO Posts: 256
    @richcoy

    if you use a move behaviour inside the rule on your actor.1 it will only move while the actor is overlapping with the wind so you can change the size of the wind actor depending on where you want the effect to occur.
  • SpinningnutmegSpinningnutmeg Member Posts: 107
    For wind I would use a timer and the accelerate behavior.
  • MrSKYoneMrSKYone Member Posts: 26
    Hey,

    Im trying to create a wind effect too, could you help me?

    I have an actor (A) going bottom up with an accelerate behavior (90 relative to scene direction and accelerate speed up to 10)

    I want to make a wind effect going from right to left so I create an invisible actor (B) on A path and set up a rule on A saying -when A overlap B, "Move" to 180 (relative to scene) with 100 in speed.

    The result is that my actor A just stop when it collides with B. I tryed to play with variable but it doesn't have any effect. Is there something wrong with what I did?

    Thanks guys
Sign In or Register to comment.