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 » Weapons Delay effect Script

Weapons Delay effect Script

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

1 Weapons Delay effect Script on Sun Aug 10, 2014 9:00 am

bilal abdel


Member [Lv. 0]
Member [Lv. 0]
Code:
var amount : float = 0.02;
var maxAmount : float = 0.03;
var smooth : float = 3;
private var def : Vector3;
 
function Start (){
    def = transform.localPosition;
}
 
function Update (){
 
        var factorX : float = -Input.GetAxis("Mouse X") * amount;
        var factorY : float = -Input.GetAxis("Mouse Y") * amount;
       
        if (factorX > maxAmount)
        factorX = maxAmount;
       
        if (factorX < -maxAmount)
        factorX = -maxAmount;
       
        if (factorY > maxAmount)
        factorY = maxAmount;
       
        if (factorY < -maxAmount)
        factorY = -maxAmount;
 
 
        var Final : Vector3 = new Vector3(def.x+factorX, def.y+factorY, def.z);
        transform.localPosition = Vector3.Lerp(transform.localPosition, Final, Time.deltaTime * smooth);       
}




just drag it in the wepons!! Wink 


View user profile

2 Re: Weapons Delay effect Script on Fri Dec 26, 2014 1:49 pm

zino2k


Member [Lv. 2]
Member [Lv. 2]
merci adel moi bouziane from algeria

View user profile https://www.youtube.com/user/zinofxmovie/videos

3 Re: Weapons Delay effect Script on Fri Jan 02, 2015 5:50 pm

Nubzx


Member [Lv. 0]
Member [Lv. 0]
Don't be trying to act like you wrote this yourself.
Someone might know where it came from and show you.

View user profile

4 Re: Weapons Delay effect Script on Mon Jun 08, 2015 8:08 pm

Survivor


{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Nubzx wrote:Don't be trying to act like you wrote this yourself.
Someone might know where it came from and show you.


Whatever, Mr. Hero forums Cop. Mad

View user profile

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