hi . Is there simple way to start working gui buttons while multitouch?
want to make my hero able to jump while walking.
and also i have a inventory which i want to use while walking.
THanks fow any help
this is my TouchButton.cs class
you’ll need to reference it in your player control script, like so
…
//theLeftandRightButtons
private TouchButton LeftButton;
private TouchButton RightButton;
//theJumpButton
private TouchButton JumpButton;
…
voidStart ()
{
//settheLeftandRightButtons
LeftButton = GameObject.Find (“LeftButton”).GetComponent();
RightButton = GameObject.Find (“RightButton”).GetComponent();
JumpButton = GameObject.Find (“JumpButton”).GetComponent();
}
…
voidFixedUpdate ()
{
//ifyourtouchisovertheLeftButton…rollleft
if (LeftButton.isTrue)
{
//go left
}
//ifyourtouchisovertheRightButton…rollleft
if (RightButton.isTrue)
{
//go right
}
if (JumpButton.isTrue)
{
//jump
}
…
i used this in my game
2300706–154885–TouchButton.cs (1.62 KB)