Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I wonder if anyone can help me with this problem I am having?
I have a sprite (cast member1) with a behaviour(Behaviour1) that I am changing during runtime to a different cast member(cast member2), which I want to have a different behaviour(Behaviour2) attached. So when I switch the sprites cast member1 to cast member2, how would I remove Behaviour1 from it and add Behaviour2. By the way the cast members are being switched in Behaviour1, so I cant see a way to remove the behaviour and attach behaviour2 from within behaviour1's script.
Any help on this problem much appreciated.
I have a sprite (cast member1) with a behaviour(Behaviour1) that I am changing during runtime to a different cast member(cast member2), which I want to have a different behaviour(Behaviour2) attached. So when I switch the sprites cast member1 to cast member2, how would I remove Behaviour1 from it and add Behaviour2. By the way the cast members are being switched in Behaviour1, so I cant see a way to remove the behaviour and attach behaviour2 from within behaviour1's script.
Any help on this problem much appreciated.