randomly spawn actors with camera moving
sumths
Member Posts: 5
Hi, I am making a game where the camera follows the main character, and spawn enemies randomly from different direction. But enemies are only spawned to one specific location.
I want to spawn enemies that with chase or follow in the direction of the main character (with camera moving).
I got a spawner, enemy and the main character in my game.
Can anyone give me an idea, please????
Best Answer
-
tatiang Posts: 11,949
It sounds like you already have an idea but you've created rules that aren't working. Post screenshots of your rules and we'll take it from there.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
https://www.dropbox.com/s/t4j8p66uegsdnp9/1.JPG
https://www.dropbox.com/s/4k519g9g98ktet4/2.JPG
https://www.dropbox.com/s/ed3ta9um79zndpz/3.JPG
thanks for your quick respond!!!
I've merged your two discussion threads. Please don't create multiple threads for the same issue.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Your spawn actor rule is set to spawn an actor at position 0,0 relative to the spawning actor. So it's always going to spawn right on top of that actor. If you want to spawn at random positions, then you need to include an expression such as random(0,1024) for the x and y values set to relative to Scene -- just like you did for the MoveTo behavior.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang sorry I am newbie to this and i just want to push it to the top of the discussion board but i don't know how to do.
I tried but it still not working.. I actually want my enemies (that's called jam) spawn with the movement of camera that it follows the direction my main character, can i do this in gamesalad?
First of all, we discourage bumping threads but do allow it if at least 24 hours have passed. Second, you can access any discussions you've already created by clicking on the My Discussions link at the top-right of the forums page.
You can but I'm not sure I understand. Do you want the jam actor to spawn right next to the main character?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang okay, i aware it now and sorry for that again.
hmm no, i want it spawn from any direction to the main character.
You have to be very specific about how you describe your game. Do you want the jam actor to spawn at the edges of the scene (and if so, what size are you using... iPhone Portrait, iPad Landscape, etc.) and then move toward the main character?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang I am doing on iphone Landscape, and the size I am now working on is w:480, h:320. And yes, I want the jam actor to spawn at the edge of top/left/right/bottom of the scene randomly every 2seconds, and then move towards the main character. And the camera will follow the movement of the main character across a large stage size.
The main character will move around the screen (with the camera following the character) avoid touching the jam actor.
So I want to spawn the jam actor in a random place (edge of top/bottom/left/right of the scene) around the moving camera.
hope i explained clear enough