Question: Spawning actors from HUD icon, different layers
AirshipScientist
Member Posts: 21
Hello,
I'm new to GameSalad and after a lot of searching on Google and the forums, I've yet to find an answer to this question. So I'll try to ask it here!
I'm working with a game idea where I have a non-scrollable HUD that has a button on it. What I want to have happen is when the button is touched, an actor spawns at the mouse/touch location and can be dragged and dropped (mouse/touch release) into a playable area. This should be able to happen several times to create multiple instances of the actor.
I've gotten most of the way there myself, but the issue I am having is that when I spawn a new actor, I think it is stuck in the HUD layer (non-scrollable), so when I scroll the background screen, the actor is mistakenly dragged along in it. I want the new actor to spawn into a scrollable layer. I've also tried doing it differently, where the actor already exists off-screen in the correct layer and is moved to the mouse location when the button is pressed, but then I do not know how to make multiple instances of the actor to do this.
Any help would be greatly appreciated! Thanks!
I'm new to GameSalad and after a lot of searching on Google and the forums, I've yet to find an answer to this question. So I'll try to ask it here!
I'm working with a game idea where I have a non-scrollable HUD that has a button on it. What I want to have happen is when the button is touched, an actor spawns at the mouse/touch location and can be dragged and dropped (mouse/touch release) into a playable area. This should be able to happen several times to create multiple instances of the actor.
I've gotten most of the way there myself, but the issue I am having is that when I spawn a new actor, I think it is stuck in the HUD layer (non-scrollable), so when I scroll the background screen, the actor is mistakenly dragged along in it. I want the new actor to spawn into a scrollable layer. I've also tried doing it differently, where the actor already exists off-screen in the correct layer and is moved to the mouse location when the button is pressed, but then I do not know how to make multiple instances of the actor to do this.
Any help would be greatly appreciated! Thanks!
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks a lot for the suggestion. This might be very simple, but I have a follow up question. Once I have the spawner spawn an actor in the correct layer, I'd like the actor to be constrained to the mouse so it can be placed and released. This seems straightforward if I only wanted to make one new actor, but I want to make multiple. If I constrain the actor prototype to the mouse position when I spawn it, any existing actors get stuck on the mouse position. I want to place each new actor individually. Hope that makes sense. Do you (or anyone else reading this!) have any recommendations? Thanks!
That way, once an actor has been placed on the scene, it won't constrain to the mouse position.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User