Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » smooth aiming

smooth aiming

View previous topic View next topic Go down  Message [Page 1 of 1]

1 smooth aiming on Sat May 30, 2015 4:26 pm

Gekheid15


Member [Lv. 0]
Member [Lv. 0]
Code:
var AimPos : Vector3;
var NormalPos : Vector3;



function Start () {
}

function Update () {
if(Input.GetMouseButton(1)){
transform.localPosition = Vector3.Lerp(transform.localPosition, AimPos, Time.deltaTime * 12);
}else{
transform.localPosition = Vector3.Lerp(transform.localPosition, NormalPos, Time.deltaTime * 10);
}
}

View user profile

2 Re: smooth aiming on Mon Jul 27, 2015 12:48 am

GorumGamer


Member [Lv. 3]
Member [Lv. 3]
Hey this is applied to the GUN, right?

View user profile

3 Re: smooth aiming on Wed Jul 29, 2015 3:38 am

Gekheid


Member [Lv. 1]
Member [Lv. 1]
GorumGamer wrote:Hey this is applied to the GUN, right?


yep

View user profile

4 Re: smooth aiming on Sun Aug 09, 2015 3:14 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
Awesome work! Thanks for sharing Smile

View user profile

5 Re: smooth aiming on Thu Dec 31, 2015 3:38 pm

stissen123


Member [Lv. 2]
Member [Lv. 2]
Although this is quite a good script, it doesnt like other weaponscripts. Thus i modified it and made my version of it:


So Simple...

View user profile

6 Re: smooth aiming on Fri Jan 08, 2016 10:51 pm

aquilinajake


Member [Lv. 3]
Member [Lv. 3]
stissen123 wrote:Although this is quite a good script, it doesnt like other weaponscripts. Thus i modified it and made my version of it:


So Simple...


well thats the point it just uses a Lerp, its effective and does the trick. however i want to try and do something similar using this method with animations etc, run, walk, idle, reload. would be interesting to see =)

View user profile http://jakeaquilina.weebly.com/

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum