Issue destroying actor
Gappsoft
Member Posts: 22
Hey all,
First of all, I'd like to thank you for taking the time to help me with this.
So here's the issue:
My actor is a jellyfish and I have used the constrain behavior to constantly change the size of the jellyfish to it looks natural.
The logic is this:
Constrain Attribute: self.Size.Width to 4*cos(self.Time*200)+30
Constrain Attribute: self.Size.Width to 4*cos(self.Time*200) + 63
Then when the jellyfish gets captured, I want the actor to be destroyed.
So I have a:
When actor overlaps or collides with actor of type: Net
Destroy
However, it doesn't destroy. Is this because I'm constraining the size so it can't destroy? Is there any workaround to this? I've been at it for a while and can't figure out a solution.
Thanks again.
First of all, I'd like to thank you for taking the time to help me with this.
So here's the issue:
My actor is a jellyfish and I have used the constrain behavior to constantly change the size of the jellyfish to it looks natural.
The logic is this:
Constrain Attribute: self.Size.Width to 4*cos(self.Time*200)+30
Constrain Attribute: self.Size.Width to 4*cos(self.Time*200) + 63
Then when the jellyfish gets captured, I want the actor to be destroyed.
So I have a:
When actor overlaps or collides with actor of type: Net
Destroy
However, it doesn't destroy. Is this because I'm constraining the size so it can't destroy? Is there any workaround to this? I've been at it for a while and can't figure out a solution.
Thanks again.
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Try using us a timer with change attribute instead of constrain:
If you have any other thoughts please run them by me!
I think it is a bug.
@SaladStraightShooter have there been any issues with using other behaviors in conjunction with constrain behaviors?
So what you have to do is make the constrain behavior stop right before the actors collide.
I did this with a timer.
First I created a real attribute called charX.
I constrained charX to the self.Position.X of my net.
Then in the timer of the jellyfish I used the expression editor. Keep in mind that the jellyfish is moving at a speed of 35.
The expression was.
(self.Position.X-(game.charX+65))/35
It now works perfectly! The 65 is the number I needed so that the jellyfish wouldn't stop in the middle of the net actor but at the front.