Two very easy questions on spawning.

PaxPaxPaxPax Member Posts: 106
edited December 2012 in Working with GS (Mac)
I want one actor to 'spawn' another actor once the game is 'on'. Below are my rules/behaviours.(BTW is there I a way for me to paste the code? is that advisable?)

My problem is that the presents are falling from the top of the scene, not in front of actor. Looked at a few youtube videos and still cannot make it work.

Santa is in the sky and spawns presents while he moves across scene.

Code:

Present - move to self position x to self positing y-400...dropping presents

Santa
- move to self position x-400 to self position y ...flying across the scene

-spawn actor(present) ---front of actor, relative to actor and no positions or direction set


Thanks in advance for any assistance.

Best Answer

Answers

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    When the spawn behavior says 'in front of actor' it actually means 'on top of' as in 'in front of the actors layer' not in front of the direction the actor is facing. If you want your packages to fall from in front of the direction santa is facing, you'll need to use the position offsets.

    Hope that makes sense.
  • PaxPaxPaxPax Member Posts: 106
    Ok I think I Understand. Will give it a try. thank you!!!
  • mrpacogpmrpacogp Member Posts: 400
    If you can't take that working, delete from scene the actor and put in later, sometimes its bugged or something
  • PaxPaxPaxPax Member Posts: 106
    OK, sorry for bugging you again. I could not get it to work. I did delete actor and try again. I also changed the position on santa. Obviously I don't know the proper positions. Thanks again if you can help.

    cc
  • PaxPaxPaxPax Member Posts: 106
    not sure how this went to 'answered' but still cannot get it to work
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    @PaxPax, you should just need to use the position offsets.

    For example assume your santa actor is 100 pixels square. If it is moving to the right and you want your packages to fall from in front of the santa actor you would just put 50 in the X postion offset box (the box with the right facing arrow).

    Since new actors spawn from the center of the actor that is spawning them this would move the center of the package actor 50 pixels from the center of the santa actor, placing it on the right side of the santa actor.
  • PaxPaxPaxPax Member Posts: 106
    OMG, While I am a newbie I should have figured that out!!! Thanks so much!!!!
Sign In or Register to comment.