Target a spawned character and edit its rotation.

rommaromma Member Posts: 114
edited March 2012 in Working with GS (Mac)
Hi Guys,

I have (every .2 seconds) actors spawning in different positions (X, Y from table) This works fine, but Ive encountered an issue.

I have actors spawning around the entire border of the scene, so technically some need to be facing down, facing left and right. For performance's sake and my sanity I want to use 1 actor and rotate the spawns IF (conditional) its at certain point in X, Y. I can't seem to target a specific spawned actor, is there a way to do this?

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    the spawned Actor controls the direction it is facing:

    on spawnedActor:
    Rule: when
    Attribute: self.Position.Y ≥ 200 (just an example Y position)
    --changeAttribute: self.Rotation To: 270 (down)
    Otherwise:
    Rule: when
    Attribute: self.Position.Y ≤ 100
    --changeAttribute: self.Rotation To: 90 (up)

    and, do a rule for X position for left and right

    you can use changeAttribute: self.Image To: … if you need images for the direction

    image MH

Answers

  • calvin9403calvin9403 Member Posts: 3,186
    do you mean a specfic one or do you want all the actors to face a point?
  • rommaromma Member Posts: 114
    A specific spawned actor.
  • rommaromma Member Posts: 114
    Thanks MH, last tip was something I didn't think of!
Sign In or Register to comment.