Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

gameobject on click unity

private void OnMouseOver() {
        Debug.Log("Hovering over GameObject");
    }
Comment

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
    }
}

Comment

PREVIOUS NEXT
Code Example
Csharp :: unity random string 
Csharp :: Unity Children Destroy 
Csharp :: c# access session in class 
Csharp :: c# add string to array 
Csharp :: how to make colliders collide with some things but not other in unity 
Csharp :: index of item in list C# 
Csharp :: Net.ServicePointManager.SecurityProtocol .net framework 4 
Csharp :: difference between alpha and beta testing 
Csharp :: average c# 
Csharp :: No migrations configuration type was found in the assembly 
Csharp :: convert string to number c# 
Csharp :: c# cancellationtoken example 
Csharp :: unity instantiate prefab 
Csharp :: instantiate object in circle 
Csharp :: c# get application root path directory 
Csharp :: joins List of strings 
Csharp :: c# sum of array elements# 
Csharp :: remove all array elements c# 
Csharp :: unity custom editor 
Csharp :: dotnet core 3.1 get the user that just logged in 
Csharp :: c# get last day of month 
Csharp :: C# using variables inside strings 
Csharp :: minimize window windows forms application c# 
Csharp :: Change Level in Unity 
Csharp :: socket io connect to namespace 
Csharp :: where in used in linq c# 
Csharp :: C# setting property values through reflection with attributes 
Csharp :: how to add rigidbody in unity 
Csharp :: Get the Photon Player GameObject 
Csharp :: jenga db connection 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =