Spawn actor WHEN I touch screen, and WHERE I touched it?

I have a thumbstick that I use to control my character, but I want it to appear on screen when touch the screen, and stay there while I am touching it, but when I dont touch, it disappear ! :D
Also, it need to appear WHERE I touched the screen you know what I mean?

Please help me I don't know how to do it, and I am sure you know!:)
Thanks

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @NicoSola welcome to GameSalad and the forums. :-)

    Your description of the thumbstick to control your character, and then for your character to appear on the screen where you touch, seem totally at odds with each other....

    But anyhow, here's how to have your character appear on-screen, and disappear when not touched:

    First make a background actor to cover the screen area; with an image, or colour, or invisible, whichever you require.

    Unlock it and in its Rules, put:

    When touch is pressed
    Change attribute scene.Background.Character.Position.X to game.Touches.Touch 1.X
    Change attribute scene.Background.Character.Position.Y to game.Touches.Touch 1.Y

    When touch is released
    Change attribute scene.Background.Character.Position.X to -100

    Hope that helps out.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.