News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • December 10, 2018, 09:18:01 AM

Login with username, password and session length

Author Topic: Joystick On Move Speed Event vanishes  (Read 814 times)

Offline piginhat

  • Newbie
  • *
  • Posts: 13
Joystick On Move Speed Event vanishes
« on: August 30, 2017, 02:02:25 PM »
I have a EasyTouchControlsCanvas with a joystick created as a prefab.  When I have it in the hierarchy I attach a game object and method to the On Move speed event and click Apply to propagate to the prefab.

However when I then look at the prefab the entry for this event has None set as the game object and so the link is lost at run time.

I am not sure if this is a Unity issue or ETC one, but would be helpful if someone could explain.

I have tried to do this at runtime:

Code: [Select]
Instantiate (easyTouchControlsCanvasPrefab);

GameObject joystick = GameObject.Find ("ScaleJoystick");

joystick.GetComponent<ETCJoystick>().onMoveSpeed += ValidateZ;

but I get the error:

error CS0019: Operator `+=' cannot be applied to operands of type `ETCJoystick.OnMoveSpeedHandler' and `method group'
« Last Edit: August 30, 2017, 02:17:09 PM by piginhat »


There are no comments for this topic. Do you want to be the first?