Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity onclick object


using UnityEngine;
using System.Collections;

public class Click : MonoBehaviour {

    public GameObject gameObjectToClick;
    void OnClick(){
         gameObjectToClick.SpecialFunction(); //call special function you wanted to call
    }
}

Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #unity #onclick #object
ADD COMMENT
Topic
Name
1+9 =