I don’t see a problem with it, heres my code:
using UnityEngine;
using System.Collections;
public class AimingDownSight : MonoBehaviour {
private Vector3 newPosition;
void awake()
{
newPosition = transform.position;
}
void Update ()
{
positionChanging();
}
void positionChanging()
{
Vector3 positionA = new Vector3 (0.3946627, -0.1788931, 0.7112392);
Vector3 positionB = new Vector3(0.009421766, -0.1324487, 0.5510964);
if (Input.GetMouseButtonDown(1))
{
newPosition = positionB;
}
else
{
newPosition = positionA;
}
}
}