Jump to content

(Solved) Is possible use "PlayAnimation" starting from specific frame???


Russell
 Share

Go to solution Solved by Russell,

Recommended Posts

Hello there again team!!

I have an animated 3D model with 2 animations:

  • IDLE or STAND (frames: 0 to 400)
  • TALKING (frame 0 to 950)

And with a version of SimpleAnimation.lua like this:

Script.Speed=4.0--float
Script.Sequence="0"--string
Script.Anim2Speed=4.0--float
Script.Anim2Sequence="0"--string

function Script:Start()--in
	self.entity:PlayAnimation(self.Sequence,self.Speed/100.0,1)
end

function Script:CambiaAnim()--in
	self.entity:PlayAnimation(self.Anim2Sequence,self.Anim2Speed/100.0,1)
end

With this script I can change the animation ok.

But I need change animation from IDLE to TALKING and TALKING animation start from frame 450.

Can I change the animation of my model starting always from frame 450? Is possible?

Thank you very much!!

Link to comment
Share on other sites

56 minutes ago, Marcousik said:

idk if you can use frames for this, i'm not sure. But you could try using a timer by testing (for example:)

if Time:GetCurrent() - self.FirstAnimStarted > 2000 then -- <start second animation>

Thanks Marcousik!!

I like the idea, but I'm not sure if it works for me in my specific case.

The animation is changed by pressing a button. From the IDLE animation (animation1) it goes to the TALK animation (animation2) and it starts at frame 0.
It would be very useful for me to get the TALK animation to start at frame 450 the same moment I push the button.

Anyway i will try this idea. Thanks!!

Link to comment
Share on other sites

  • Solution
2 hours ago, Thirsty Panther said:

You could split your Talk animation in two.

Talk 1 animation 0-950

Talk 2 animation 450-950

Then just call the animation you want.

Thirsty Panther nice to read you too!!

I love you man!! This save my day!!

I didn't know that I could extract fragments of the animations openen in the *.mdl models from ASSETS tab!!

Now i have "Talk2Ticket" animation for my model, and the full "Talk" animation for other actions ingame.

Works great!! Thank you very much!!

For other people if they reach this thread with the same question:

extract.jpg.cbc779b7f679e59f0b0f6b1ec8f059cc.jpg

  • Like 1
Link to comment
Share on other sites

  • Russell changed the title to (Solved) Is possible use "PlayAnimation" starting from specific frame???

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.

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.

 Share

×
×
  • Create New...