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
Share
Go down
avatar
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 1448
Rep : 0
Join date : 2014-08-06
View user profile

Weapons Delay effect Script

on Sun Aug 10, 2014 9:00 am
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 


avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 9
Points : 1328
Rep : 1
Join date : 2014-12-23
View user profilehttps://www.youtube.com/user/zinofxmovie/videos

Re: Weapons Delay effect Script

on Fri Dec 26, 2014 1:49 pm
merci adel moi bouziane from algeria
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 1592
Rep : 0
Join date : 2014-03-13
View user profile

Re: Weapons Delay effect Script

on Fri Jan 02, 2015 5:50 pm
Don't be trying to act like you wrote this yourself.
Someone might know where it came from and show you.
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1623
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Re: Weapons Delay effect Script

on Mon Jun 08, 2015 8:08 pm
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
Back to top
Permissions in this forum:
You cannot reply to topics in this forum