Answers for "unity c# getaxis wasd"

C#
1

onmouseclick unity

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;public class ExampleClass : MonoBehaviour
{
    void OnMouseDown()
    {
        // Destroy the gameObject after clicking on it
        Destroy(gameObject);
    }
}
Posted by: Guest on January-29-2020
0

unity pingpong

void Update()
    {
        // Set the x position to loop between 0 and 3
        transform.position = new Vector3(Mathf.PingPong(Time.time, 3), transform.position.y, transform.position.z);
    }
Posted by: Guest on February-01-2020

C# Answers by Framework

Browse Popular Code Answers by Language