Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

OneManArmy

Script for weapon (delay effect)

Recommended Posts

Please login or register to see this quote.

Oh nevermind, got confused with bibbobbib's comment. I think what killerkip meant was there were no trees around so why are birds flying around?

  • Like 1

Share this post


Link to post
Share on other sites

LOL i just wrote the comment about how there are birds the owl is cool but the birds are anoing

Share this post


Link to post
Share on other sites

If someone wants a mp version of this which is stopped when the game is paused (cursor is not locked)

 

[spoiler=Script]

 

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 (){
if(networkView.isMine){
if(Screen.lockCursor == true){
 
        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);        
}
 
else{
return;
}
}
}

Share this post


Link to post
Share on other sites
Guest altjen

should we remove the old scripts or just put together??????

Share this post


Link to post
Share on other sites

Hello, I have a problem.. This script only works if i disable my animator.. Anyone knows why? 

 

EDIT:

Found solution!

Edited by Wiebrendh

Share this post


Link to post
Share on other sites

Anyone have any tips on adjusting this.

Having a lot of trouble when I use ADS, my acog scope is all over the place haha.

Seems to not react fast enough.

 

 

EDIT:

Forgot to mention I am not using FPS Kit.

Edited by Nubzx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×