randomly spawn actors with camera moving

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

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • sumthssumths Member Posts: 5

    @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?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @sumths said:
    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.

    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.

    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?

    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

  • sumthssumths Member Posts: 5

    @tatiang okay, i aware it now and sorry for that again.

    hmm no, i want it spawn from any direction to the main character.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @sumths said:
    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

  • sumthssumths Member Posts: 5

    @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 :smile:

Sign In or Register to comment.