Explosion Youtube

fullviewmediafullviewmedia Member Posts: 92
edited November -1 in Working with GS (Mac)
Hi all,

I have watched the video on creating an explosion and it works well with all of my actors except 1 (the main character), when the character is near the explosion the actor is drawn towards the explosion not moved away. This does not happen with any other actor and the settings are duplicated.

Does anyone else have this happen?

Thanks

Comments

  • POMPOM Member Posts: 2,599
    I dont know what method you use for this cause i dont see your rules , but here is an advice that might work:
    in the actor the pulls toward instead of away , there is a rule for this movement , and i guess that this rule has an equation , try to add *(-1) to it to reverse the rule.

    Roy.
  • Piero1987Piero1987 Member Posts: 38
    tshirtbooth, i send u a pvt message please can u answer me :(
  • fullviewmediafullviewmedia Member Posts: 92
    Hi tshirtbooth, I think it was your video on youtube, logic is:-

    if distance from blast is less than 300
    change velocity
    (vectorToAngle(-( game.blastx - self.Position.X ),+( game.blasty - self.Position.Y )))
    rotate to angle
    (vectorToAngle(( game.blastx - self.Position.X ),-( game.blasty - self.Position.Y )))

    change atribute
    magnitude( game.blastx - self.Position.X , game.blasty - self.Position.Y )

    This may have come from an old video :)

    Thanks

    JOhn
  • fullviewmediafullviewmedia Member Posts: 92
    Found the video :)

  • fullviewmediafullviewmedia Member Posts: 92
    Sorry there is a + sign which i added to see if things changed, is was a - and is a -

    :)
  • fullviewmediafullviewmedia Member Posts: 92
    Can anyone shed some light on this. Can you tell me if the code I used in the video is still relevant?

    Thanks
  • fullviewmediafullviewmedia Member Posts: 92
    I kind of get what your saying but I am also confused by your comment

    "In the change velocity behaviour you have
    speed
    400*(game.distancefromblast*4)"

    I have the following which came from the video and seems to work ok in the video :(

    change velocity
    (vectorToAngle(-( game.blastx - self.Position.X ),+( game.blasty - self.Position.Y )))

    It also works well on other actors, maybe i'll wait for the updated video, it will be something I am doing somewhere else maybe and i'll just need to read through the code again.

    Thanks
  • forkliftforklift Member Posts: 386
    The problem is, in the video the change velocity in the box actors is set to actor. Set it to scene and they'll always blast away from the bomb. What's happening is some will rotate and use the velocity of its facing direction. When it's set to scene, they will always use the direction of facing away from the box.
  • forkliftforklift Member Posts: 386
    PS. Thanks for all your awesome tuts, tshirt!
  • fullviewmediafullviewmedia Member Posts: 92
    That was it, dam spent hours on that watching the video over 20 times thinking I must be missing something. Not knocking the video :) got me 99% there.

    Thanks

    John
Sign In or Register to comment.