Spawn Actor At Touch?
peachpellen
Member Posts: 977
Here's the thing;
I want to spawn an actor every time a player touches a space inside a square.
The problem is, I want the actor to spawn in the same place the player touches; not the center of the square and not at set co-ords.
Can anyone tell me how to do this? ^-^;
I want to spawn an actor every time a player touches a space inside a square.
The problem is, I want the actor to spawn in the same place the player touches; not the center of the square and not at set co-ords.
Can anyone tell me how to do this? ^-^;
Comments
Select the square and edit it. Set a rule for touch pressed. When you set the spawn rule for position use the new playerX and playerY as the coordinates. This will make them spawn at your finger press position.
Hope that makes sense.
But thank you - I shall attempt this now and let you know how it goes
These attributes - are they integers or....?
Also with self.touchx and self.touchy - are these within the square or within the actor being spawned?
Sorry >.<' I've never had to do this before.
Thanks
I use a Rule
When all conditions are valid
Actor receives event Touch is inside
Attribute (Devices/Touches) Game.Touches.count) = 1
Spawn actor
Position x = (Devices/Touches) game.Touches.Touch 1.X
Position y = (Devices/Touches) game.Touches.Touch 1.Y
Note.
Copy/Pasting this code won't work. You need to go through the GS scripting system.