Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I need a lot of help with coding Animation!


Recommended Posts

Just some background:

i am making a game for a research project for school. I have no prior experience with coding so I'm a bit dumb

Here's my question: How do i code in my animations?

there are a lot of little things out there but they don't help me, i would appreciate it if someone were to explain it to me for my specific case. i have all of the animations done, i made them in blender. so far the only code i have is from these two posts, however i've moved the camera so that it is from a third person view: 

 

this whole animation thing has really been demotivating as i just dont know what i need so it would be nice to move past this to something equally as painful to find out. 

btw whilst researching i found there is very little helpful information out there anymore. there are countless posts where there are videos and websites linked however there they are either taken down or private, which is annoying because they could be helpful. 

 

either way, thank you for reading, i hope you understand what i mean and hope you might help me. Honestly all i need is a step-by-step (kind of) guide to how i get my animations to show for all my characters.

Link to post
31 minutes ago, 💎Yue💎 said:

I think you should first go through a deep engine learning process before a big project.

Any specific questions to be answered?

thats a fair point, however i didnt have a lot of time to prepare so didnt think about that, maybe next time. do you have a link to a good deep engine learning process?

 

as for questions, its really just about a code that gets animations to show, eg pressing 'w' will move forward AND play a running animation rather than just moving forward.

Do i have to call my animations specific names?

how can i specify which animation i want?

literally anything to do with coding animation

thank you for commenting

Link to post
1 hour ago, Datman1331 said:

thats a fair point, however i didnt have a lot of time to prepare so didnt think about that, maybe next time. do you have a link to a good deep engine learning process?

 

as for questions, its really just about a code that gets animations to show, eg pressing 'w' will move forward AND play a running animation rather than just moving forward.

Do i have to call my animations specific names?

how can i specify which animation i want?

literally anything to do with coding animation

thank you for commenting

function Script:UpdateWorld()

         self.anim = "Idle"

         if Window:GetCurrent():KeyDown(Key.W) then

                 self.anim = "Walk"
              if Window:GetCurrent():KeyDown(Key.Shift) then

                  self.anim = "Run"

              end

         self.entity:PlayAnimation(self.anim)
end

 

Any questions I am ready to answer.

The PlayAnimation command has different parameters, among those if the animation is a single shot that is useful to check when the animation reaches the end and ends.  This triggers a check on a method of the script the last one down, the entity script.

Link to post
On 8/28/2020 at 4:27 PM, 💎Yue💎 said:

function Script:UpdateWorld()

         self.anim = "Idle"

         if Window:GetCurrent():KeyDown(Key.W) then

                 self.anim = "Walk"
              if Window:GetCurrent():KeyDown(Key.Shift) then

                  self.anim = "Run"

              end

         self.entity:PlayAnimation(self.anim)
end

 

Any questions I am ready to answer.

The PlayAnimation command has different parameters, among those if the animation is a single shot that is useful to check when the animation reaches the end and ends.  This triggers a check on a method of the script the last one down, the entity script.

i think i kind of understand how the code is meant to work however i tried it and it didn't work, maybe because it doesn't fit my code? i tried to put it in a few different places in the code but the animations didn't seem to want to play. sorry for the late reply, i had some exams.

 

slightly unrelated, but i did observe something else: because im lazy i decided to put the "soldier" script onto what i wanted to be an enemy character. somehow, it sort of worked! when i got near it i can see its idle animation play! however it didnt move at all when i came near it.

i was just wondering 1- why did the animations work there? 2- how do i get it to attack the player

i dont believe i changed the script at all so something must be wrong with the player script-- i just dont know what. if you're still up for helping me that would be much appreciated as i am losing hope for this project. 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...