#TurretEventHook

58 messages · Page 1 of 1 (latest)

deep creek
#

wanted to have a hatch open/close on my vehicle when a player enters the turret seat
I made the animation and all but I'm struggling to have it play in game

#

<@&553315866146766850>

daring cedar
#

@deep creek link "Any state" to your animations, and link "Entry" to an empty state (create one)

deep creek
muted seal
#

you dont need the transitions from any state

#

just from entry to empty

#

you need to creae an animation clip, door open, and animate your door opening

#

then duplicate the clip inside the animator, rename it to close, set it's speed to -1

#

and lastly for your on passenger added/removed, you'll use animator > play (string) and type in the name of the clip (open/close)

#

make sure you check your animation clip so it's not looping. Any created clips loop by default

#

even the entry to empty transition is optional. You can just have close be the default state

deep creek
#

elite zoli knowledge

#

doing all that right now

muted seal
#

the only thing you need to know is that the animator cant play the same clip again if it was played previously. When it ends and it has no transition, it's still considered active. You cant play the active clip again

#

this is the only situation where you need transitions

#

this is used for miniguns for example

#

a very short barrel spinning, non looped animation that transitions into a barrel stop animation

#

on shot fired you trigger animator.play(string) barrel_spin, over and over again, which will continuously spin since you are transitioning it into another animation clip, therefore the spin clip becomes inactive and can be called again

#

there's a better way for barrels nowadays but i explained it here as an idea/use case for transitions

#

also you can replace animators entirely and use animations

#

animators are very heavy on performance

#

for animations, it's a bit dumber to play them and they dont support transitions

#

but they are called once and that's it, rather than being active all the time and waiting for input

deep creek
#

wait
animate the door opening in unity
I did it in blender

muted seal
#

so where possible, use animations instead

muted seal
#

tho, you should re-do the animation in unity imo

#

makes things quite a bit easier

#

i personally never had any luck with blender animations

deep creek
muted seal
#

this is with an animator

#

it's used on an item to play the shooting animation

#

it has to be in that order

#

the enable/disable is optional i think

#

in my case it's needed cause of the reload animation

deep creek
#

sorry for ping btw

#

and this is the thing I want animated

muted seal
#

yeah it should be something like that

#

i never actually tried using animations on vehicles so we'll see how it works

#

i'll probably convert most of my new mods to that so they take less performance

deep creek
#

very nice

#

and just wanna ask
I'm guessing your Unturned Let Loose realistic tank rotation turrets need custom scripts that aren't very easy to make?

muted seal
#

doesnt use any custom scripts

#

it doesnt even use a turret event hook because that didnt exist when i made it xD

deep creek
#

wha...

muted seal
#

i made it in 2020 when some russian guy told me my abrams sucks because it doesnt have a turret turning system, while his tank is much better because it had one. So i spent like 8 hours and made pretty much what i still use today

#

i'm pretty sure he blocked me afterwards

deep creek
#

how do you even limit the turret's rotation speed
is this something that I'll just figure out if I learn a lot more of actual unity stuff?

deep creek
muted seal
#

yeah you should be able to figure it out just by messing about with unity and making logics systems

#

i made some changs to it for HLL actually to make it smoother and sync on servers

deep creek
#

nice
loading in now to see if it works

#

now the hatch is constantly shut lol

muted seal
#

i'll check it out in the morning on my side

#

if not, just go for an animator

#

those are straightforward to use