playMaker

Author Topic: How to change game object when screen is tapped/touched.  (Read 1076 times)

GeezyGuy121

  • Playmaker Newbie
  • *
  • Posts: 6
How to change game object when screen is tapped/touched.
« on: January 22, 2023, 01:44:32 PM »
I've been trying to implement this but haven't been able to so far. Does anyone have a way I can go about this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: How to change game object when screen is tapped/touched.
« Reply #1 on: January 23, 2023, 01:42:02 AM »
Hi.
Which part you have problems with?

For touch, I believe you have Touch Event action.

What you want to change with the object? select a different object/swap to a different object?

GeezyGuy121

  • Playmaker Newbie
  • *
  • Posts: 6
Re: How to change game object when screen is tapped/touched.
« Reply #2 on: January 23, 2023, 11:48:17 AM »
Hi.
Which part you have problems with?

For touch, I believe you have Touch Event action.

What you want to change with the object? select a different object/swap to a different object?

I'm trying to change shapes. So for instance if it's a square when tapped it would change into a circle, tapped again then it would change to a triangle etc.. That's what I'm trying to implement

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: How to change game object when screen is tapped/touched.
« Reply #3 on: January 24, 2023, 02:38:21 AM »
Hi.

something like this :

set a int variable called 'index'

State 1 :
'Touch Event' (to register if touched)

State 2 : set this state as sequence (rightclick on a empty space in the action panel and select to enable)

'Int Add' + 1 (index)
'Int Compare' if less or equal / FINISH (leave Greater empty)
'Set Int Value' (index) set to 0

state 3
int switch (set 3 values, 0,1,2) and connect to 4a / 4b / 4c

state 4a / state 4b / state 4c (for each state, activate 1 and deactivate the other)
'Activate Game Object' Circle (true of false)
'Activate Game Object' Square (true of false)
'Activate Game Object' Triangle (true of false)

Transition back to State 1