first person view unity
// C Sharp
public Transform followTarget;
public Vector3 targetOffset;
public float moveSpeed = 2f;
private Transform myTransform;
void Start(){
myTransform = transform;
}
public void SetTarget(Transfrom aTransform){
followTarget = aTransform;
}
void LateUpdate(){
if(followTarget != null){
myTransform.position = Vector3.Lerp(myTransform.position, followTarget.position + targetOffset, moveSpeed * Time.deltaTime);
}
}
Also in C:
- c program to swap two arrays
- print hello world in c
- Access denied creating xampp-control.ini
- how to make infinite loop in c
- root in C
- how to transfer textbox fro string to integer vb.net
- matplotlib legend remove box
- how to pass an array value to a pthread in c
- c matrix sintax
- uint32_t extract first bits
- counter program in c language
- arduino ip to string
- what is fprintf in c
- c remove element from array
- es palindromo
- How to setup a line length marker in vim
- what is conio.h
- how to create random integers from a specific range in c language
- 1 212 32123 4321234 543212345 in c
- C printf to string
- how to open chrome using cmd
- linux kernel write()
- c unused parameter
- how to add a comment in c