Spawning on Touch

Hey guys I have come into an error. I have my game set up so that when you touch the spawner actor it spawns wherever you touched it. It was working but when I made the scene size bigger by width and made the spawn actor bigger (same as scene size) it won't spawn in the part that was extended.

Comments

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

    You're spawning an actor the size of the scene? What is the scene size? And what is the actor size?

    Having an actor spawn itself on touch seems like a recipe for disaster (i.e. crashing your app). Is there a reason you're doing it that way? Or does your spawner actor actually spawn a different actor?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tpjacobsontpjacobson Member Posts: 33

    @tatiang the spawner is invisible and o spawns a actor and the size of the scene is 320 by 1600 landscape fpr example(when spawner is touched spawn (actor)block1 in touch position x and y)

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

    If you're game.Touches.Touch 1.X, you'll need to add scene.Camera.Origin.X to the X value. Same for Y. To access scene attributes, you have to unlock an actor. I like to use a single unlocked actor to constrain game.cameraX (and Y) to scene.Camera.Origin.X and then just reference game.cameraX in the spawner actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

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

    Here's a demo made in Mac Creator (you can Google how to open it on a PC).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.