Issue destroying actor

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.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    At least one of you actors has to have Movable checked, does at least one?
  • SocksSocks London, UK.Member Posts: 12,822
    @Gappsoft

    Try using us a timer with change attribute instead of constrain:

    image
  • GappsoftGappsoft Member Posts: 22
    Socks, good thought but it kills the devices memory making the game run at only about 5 fps.
    If you have any other thoughts please run them by me!
  • GappsoftGappsoft Member Posts: 22
    I was thinking about creating a change attribute to change opacity to zero when they collide but that doesn't work either.
    I think it is a bug.
    @SaladStraightShooter have there been any issues with using other behaviors in conjunction with constrain behaviors?
  • GappsoftGappsoft Member Posts: 22
    I figured it out.
    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.
Sign In or Register to comment.