Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Actor back to default animation  (Read 3601 times)

0 Members and 1 Guest are viewing this topic.

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Actor back to default animation
« on: April 11, 2013, 12:13:56 PM »

I know it will sound stupid to most of you, but I've got this problem...

I need my actor to change his idle animation after a certain action and to obtain this I used the code:

Code: [Select]
actor.SetSprite("actors/Lars/ul/defaultposter.sprite");

The problem is I don't know how to go back to normality! If I use this code the actor will ALWAYS use "defaultposter.sprite".
Probably there must be a simple function to obtain what I need, but I can't find it!
Can somebody give me a help?
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: Actor back to default animation
« Reply #1 on: April 11, 2013, 12:27:05 PM »

How a something like

Code: [Select]
if (condition_met == false)
  {
   actor.SetSprite("actors/Lars/ul/defaultposter.sprite");
  }
else
 {

actor.SetSprite("actors/Lars/ul/other.sprite");

}

where condition_met is a global
Logged

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Re: Actor back to default animation
« Reply #2 on: April 11, 2013, 01:11:47 PM »

But if I use again SetSprite the problem persist because the actor will use THAT sprite("other") for every standing animation...
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Actor back to default animation
« Reply #3 on: April 11, 2013, 01:52:17 PM »

To reset the value, just use actor.SetSprite(null);
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Re: Actor back to default animation
« Reply #4 on: April 11, 2013, 02:14:38 PM »

I knew it had to be THAt easy.
Thank you very much and I apology for opening such a simple thread!
Logged
 

Page created in 0.026 seconds with 20 queries.