Hi, i need the script for reset the position of my 3d model in the start position.
You would simply store the position in awake or start and then have a method to reset the model to that stored position. You would likely also want to store the rotation as well though.
1 Like
Iām noob, can you help me? this is the code for rotation of the object
using UnityEngine;
using System.Collections;
public class rotObj : MonoBehaviour
{
float rotSpeed = 10;
void OnMouseDrag()
{
float rotX = Input.GetAxis("Mouse X") * rotSpeed * Mathf.Deg2Rad;
float rotY = Input.GetAxis("Mouse Y") * rotSpeed * Mathf.Deg2Rad;
transform.RotateAround(Vector3.up, -rotX);
transform.RotateAround(Vector3.right, rotY);
}
}