Define when actor has landed on the right side.

joelEjoelE Member Posts: 30
edited November -1 in Working with GS (Mac)
I want to define when my actor (square) collides with the ground on its bottom edge as "landed" and any of the other 3 edges as "crashed"

i've messed around with booleans for a bit but haven't cracked it so far.

any wisdom?

Comments

  • EdwardFEdwardF Member Posts: 27
    Have a rule check for ALL:

    1) Collision with Ground
    2) self.Motion.Linear Velocity.X = 0
    3) self.rotation ≠ 0

    That should do it.
  • joelEjoelE Member Posts: 30
    Thanks Ed,

    that makes sense but it doesn't work for me.

    If ive got it right, created rule for the
    1) Collision with Ground
    2) self.Motion.Linear Velocity.X = 0
    3) self.rotation ≠ 0
    when these conditions are met the "landed" boolean becomes false.

    I've got a display text behavior on there to let me know when the actor lands false of the landed rule and she ain't saying nuthin.

    I think i need to define the bottom side of my actor another way.

    any more ideas?
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    You could constrain an invisible actor that's located at the bottom edge of the square. When the invisible actor collides with the ground, whatever you want to happen, can happen (e.g. an attribute is set).
  • joelEjoelE Member Posts: 30
    Thanks Jshimane,

    I had a little play around with that and got some weird results its almost like the invisible actor constrains to the scene rather than the actor. and the X and Y get flipped over.
    I have a size changing constrain on the visible actor which might be causing the invisi actor to react in this way.

    ill have another look at it later.

    thanks for your help though.
  • joelEjoelE Member Posts: 30
    Thanks Jshimane,

    I've fixed my mental errors and this is working a treat.

    constraining invisible actors is in the pocket.
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    You're welcome!

    I've been using GS for exactly 1 month and I'm about 1 week from submitting my first game. I could not have done it without watching all of tshirtbooth's video tutorials (and utopian game's ones) and finding answers in the forums. Everybody here is so helpful and that can only make the GS games better!
Sign In or Register to comment.