#Changing a rigs animations depending on a players move direction.

153 messages · Page 1 of 1 (latest)

quick rampart
#

I'm trying to make a game based off Jojo's bizarre adventure, what happens in jojo is that people have this things called stands that basically are humanoid ghosts that fight with each other. I made it so the player has a stand. And what I want to do is change the animations of the stand (idle, backwards movement, sideways movement, etc) depending on the players move direction. I tried to get the move direction of the player, and send an event depending the direction. Then In a server server I tried to change the animations depending on the events but I had some trouble. Any help would be appreciated.

thick turret
vocal thunder
#

So

#

Basically

#

You can do like

#
local uis = game:GetService("UserInputService")

local holdingW = false
local holdingS = false
local holdingD = false
local holdingA = false

local wAnim = instance.new("Animation", stand)
wAnim.AnimationId = "rbxassetid://00000000000"
local animTrackW = stand:WaitForChild("Humanoid"):LoadAnim(wAnim)
--Copy Paste this with all your anims

uis.InputBegan:Connect(function(input, gpe)
  if not gpe then
    if input.Keycode == Enum.KeyCode.W then
      holdingW = true
      animTrackW:Play()
 --Copy paste this with the other 3 keybinds and change them to elseif statements
    end
end

uis.InputEnded:Connect(function(input, gpe)
  if not gpe then
  if input.Keycode == Enum.KeyCode.W then
    holdingW = false
    animTrackW:Stop()
  end
--Copy paste this with the other 3 keybinds and change them to elseif statements
end
#

hopefully this helps

#

@quick rampart

#

you would obviously have to make these animations first, then make then make them each move in a different direction

quick rampart
vocal thunder
#

idk how yours is scripted

#

you have to change it according to yours

quick rampart
vocal thunder
#

sure

quick rampart
# vocal thunder sure

So instead of saying "Sorry I cant help you" or anything similar, you instead just say "sure" and leave without saying anything? Wow you are a great example for new scripters man, keep up the good work.

vocal thunder
#

you asked me a question

#

and i said yes

#

i assumed that when you asked me that question you would implement it yourself

quick rampart
#

i found an issue in your script

#

i told you

#

what if the player is looking at the character's behind

#

and he presses "S" to move forward

vocal thunder
#

and then you gave a suggestion

vocal thunder
#

and i said yes you can use your own suggestion

#

why are you blaming me

quick rampart
#

thats the problem

#

how can i do that

vocal thunder
#

bro.

quick rampart
#

how would I use move direction

vocal thunder
#

the way you asked the question was as if you were familliar with the function

quick rampart
#

to do that

vocal thunder
#

you can't blame me when you said something that made it seem as if oyu were familliar with it

quick rampart
#

If I knew how it worked I wouldn't be here

vocal thunder
#

after giving that suggestion you didn't ask for anything else

#

so when you didn't reply i assumed you figured it out

quick rampart
#

i asked if we could maybe use the move direction

vocal thunder
#

you didn't say we

#

you said "Maybe movidrection would be better in this situation?"

#

makes it seem as if you understand the function

#

then you didn't say anything else

quick rampart
#

yea I said move direction would be better because Ive seen in devforum people using it to change the players animations with it

#

and so i thought that it was needed

vocal thunder
#

Yeah then you didn't say anything else

#

if someone asks a question and i give them an answer and they don't say anything else, wouldn't it only be logical to assume they've figured it out?

quick rampart
#

usually everyone that helped me would keep up with a convo

#

you send a script and left

vocal thunder
#

explained it

#

saying you would have to change it accordingly

#

you said

quick rampart
#

user input service isn't the best

vocal thunder
#

"Can i use movedirection"

quick rampart
#

for the reason i said

vocal thunder
#

Then you said nothing else

vocal thunder
quick rampart
#

i said that move direction would be better in this situation bro, meaning we should try to use that, instead of uis

vocal thunder
#

if someone says nothing after recieving an answer

vocal thunder
#

you said "wouldn't it be better"

#

Suggesting that one option is better than the other immeidately shows that you have an understanding of how both work, so you are suggesting the other function over the original one

#

do you understand how the way you phrase your sentences can affect the perception of it?

#

This is going back to english class

quick rampart
#

i dont know man, if I want to help someone and they said something like "maybe we should do this?" then I would try to help them to what they said

vocal thunder
#

you didn't say "Maybe we should do this" though

vocal thunder
#

in fact i'm not even gonna repeat it just read what i said

vocal thunder
#

you showed that by saying one function was better than the other

#

you don't even understand what i'm saying

#

???

quick rampart
#

yea because anything would be better than uis. I know that uis has an issue and ive seen in devforum that the other function doesnt have any

vocal thunder
#

if i'm in math class right

#

and my teacher gives me a formula

#

and i say "What if we just use this formula instead"

#

the formula i suggested works

#

but i myself don't know how the formula works

#

then my teacher says "Yeah you can use that formula"

#

then at the end of class i say "Why didn't you teach me how to use the formula that I suggested????"

#

then the teacher says "Because you are the one who suggested it and you didn't ask for anything after that, so i assumed that you knew since you even know the name of the formula"

#

🤷‍♂️

quick rampart
#

Now let me make an example too

vocal thunder
quick rampart
#

haer this out and leave

#

i did

vocal thunder
#

Ok then make a response

#

instead of responding with another example

#

give a response to my example

#

whats wrong with it

quick rampart
#

ill show you with my example

vocal thunder
#

No

#

Explain

#

mine

#

give a response

quick rampart
#

has an issue

#

let me make my exmaple now

vocal thunder
quick rampart
#

so lets say that im in that same math class

vocal thunder
#

you don't understand anything at all

#

thats not the point

#

the point is that

quick rampart
#

and our teacher gives us a formula

#

but the formula is wrong and i suggest a new one

vocal thunder
#

the student REALISED the teacher has a bad formula, so he suggested his own formula but doesn't even understand it himself

quick rampart
#

does the teacher say

#

"Ok sure"

vocal thunder
quick rampart
#

and leaves the class?

vocal thunder
#

Does any teacher leave the class

#

🤷‍♂️

quick rampart
#

you are the teacher

#

in the example

#

you just left with a non functional formula

vocal thunder
#

yeah but

#

you suggested a different formula

#

i expect you to change it accoringly

#

i EVEN SAID HERE

vocal thunder
#

i even said change it accoringly

#

let me tell you something

#

SCRIPTING is not a formula

#

scripting is diverse

#

scripting INCLUDES formulas but it requires you to THINK of ways to make everything work

quick rampart
vocal thunder
#

you didn't say that

quick rampart
#

thats literally the title of the post

#

or the desc

#

m

#

mb

vocal thunder
#

THIS

#

is the tital of the post

#

and the description

quick rampart
#

yea ik

#

i said i had problems using move direction

#

and events

vocal thunder
#

I gave you a solution

#

and then you came up with another solution

#

yk what i don't even wanna talk anymore

#

i have 5 commissions waiting on me

quick rampart
#

why stubborn bro damnn

#

i said I had issue working with move direction = this means I dont know how to use move direction

#

and then you use a wrong method,

#

I correct you and suggest we use the function that ive seen people work better with (movedirection)

#

and then you leave