FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionWeapons Delay effect Script

more_horiz

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 


descriptionRe: Weapons Delay effect Script

more_horiz
merci adel moi bouziane from algeria

descriptionRe: Weapons Delay effect Script

more_horiz
Don't be trying to act like you wrote this yourself.
Someone might know where it came from and show you.

descriptionRe: Weapons Delay effect Script

more_horiz
[You must be registered and logged in to see this link.] 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
Permissions in this forum:
You cannot reply to topics in this forum