Datman1331 Posted August 28, 2020 Share Posted August 28, 2020 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. Quote Link to comment Share on other sites More sharing options...
Yue Posted August 28, 2020 Share Posted August 28, 2020 I think you should first go through a deep engine learning process before a big project. Any specific questions to be answered? Quote Link to comment Share on other sites More sharing options...
Datman1331 Posted August 28, 2020 Author Share Posted August 28, 2020 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 Quote Link to comment Share on other sites More sharing options...
Yue Posted August 28, 2020 Share Posted August 28, 2020 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted August 29, 2020 Share Posted August 29, 2020 https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_PlayAnimation Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Datman1331 Posted September 4, 2020 Author Share Posted September 4, 2020 On 8/29/2020 at 6:34 AM, Josh said: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_PlayAnimation thanks but i've looked at that a lot and my small brain can't figure it out from that. the problem it that i dont really know what i need in order to get it to work beacause i have tried things but they never work Quote Link to comment Share on other sites More sharing options...
Datman1331 Posted September 4, 2020 Author Share Posted September 4, 2020 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. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted September 4, 2020 Share Posted September 4, 2020 Did you create a NavMesh? Quote Link to comment Share on other sites More sharing options...
Yue Posted September 4, 2020 Share Posted September 4, 2020 1 - Animated entity. ( Mesh ) 2 - Hook a script to that entity. 3 - Simple example in the Start function of the script. function Script:Start() self.entity:PlayAnimation("Idle") end Quote Link to comment Share on other sites More sharing options...
Datman1331 Posted September 6, 2020 Author Share Posted September 6, 2020 On 9/4/2020 at 7:17 PM, havenphillip said: Did you create a NavMesh? probably not how do i do that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.