#that entirely depends on the values you

1 messages · Page 1 of 1 (latest)

abstract galleon
glacial quail
#

just test different values until you've found some you like. it's going to be 100% personal preference

abstract galleon
#

ok ill do

#

what values should i be changing?

#

angular drag?

glacial quail
#

in the video i showed you i used 12 for the regular movement speed and 6 for the drag

abstract galleon
#

ok

glacial quail
#

angular drag can be left alone since you're preventing rotation anyway

#

you need to adjust the amount of force you are applying (your various speed variables) and the linear drag

abstract galleon
#

thanks

#

i appreciate the time you have taken

#

ok so now that i have settings i like, now we can move on to the very last thing

#

knockback.

glacial quail
#

all you need to do for that is apply force when you shoot using -transform.right * whatever variable for the amount of force you want and ForceMode2D.Impulse

abstract galleon
#

ok and this will shoot in the opposite dirrection the gun is facing?

glacial quail
#

try it and find out

abstract galleon
#

ok

#

and just to be clear rb.addforce(transform.right * power, ForceMode2D.Impulse); correct?

glacial quail
#

no, transform.right is already a vector, you don't need to create a new vector2 from it

#

just multiply it by power

abstract galleon
#

oh

#

lemme edit that

#

better?

glacial quail
#

try it and find out

#

you have a compiler that will give you errors if you've written the code wrong

abstract galleon
#

ok

#

also transform = gun, or pivot point correct?

#

or no

glacial quail
#

either the gun or the pivot that rotates, in the video i sent before i used the pivot but either one would work

abstract galleon
#

ok

#

yeah

#

i can work with this

#

and this should all be in fixedupdate?

glacial quail
#

get input in Update, apply force in FixedUpdate (though like i mentioned before, one-off forces that use ForceMode2D.Impulse are generally fine in Update)

abstract galleon
#

ok

#

ok i got the effect i wanted

#

but i wanted it to be reversed

glacial quail
#

-

abstract galleon
#

so you would push away from the direction faceing the gun

#

what if i divided by power?

glacial quail
#

-transform.right is the opposite direction

abstract galleon
#

ok

#

i miss read you chat

#

ok i got the exact effect that i wanted