Two very easy questions on spawning.
PaxPax
Member Posts: 106
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.
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
-
jamie_c ImagineLabs.rocks Posts: 5,772
Answers
Hope that makes sense.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
cc
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page