What do you want to save?
Add Code snippet
New code examples
-
C# 2021-11-06 22:09:09
unity character controller moving platform
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SC_MovingPlatform : MonoBehaviour { public Transform activePlatform; CharacterController controller; Vector3 moveDirection; Vector3 activeGlobalP... Add solution -
Other 2021-11-05 00:10:07
how to make character rotate to the direction of the mouse in unity2d
using UnityEngine; using System.Collections; public class SCR_mouseRotation : MonoBehaviour { void Update () { Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.z, 10); Vec... Add solution -
Other 2021-11-01 15:56:13
lookrotation only on x axis
Vector3 relativePos = target.position - transform.position; Quaternion LookAtRotation = Quaternion.LookRotation( relativePos ); Quaternion LookAtRotationOnly_Y = Quaternion.Euler(transform.rotation.eulerAngles.x, LookAtRotation.eulerA... Add solution -
C# 2021-10-30 03:34:19
how to change rotate with script unity
var rotationVector = transform.rotation.eulerAngles; rotationVector.z = 0; //this number is the degree of rotation around Z Axis transform.rotation = Quaternion.Euler(rotationVector); //if you put this in a coroutine and yielding for some amount of time ... Add solution -
C# 2021-10-27 01:11:12
how to make a follow script in unity
var target : Transform; //the enemy's target var moveSpeed = 3; //move speed var rotationSpeed = 3; //speed of turning var range : float=10f; var range2 : float=10f; var stop : float=0; var myTransform : Transform; //current transform data of this enemy ... Add solution