Collision with Actor while Interpolating size of Actor
Hi All
I am increasing the width and height of an actor (with Interpolate), which is working fine.
The issue I have is that I want to destroy any actors it come into contact with while its increasing in size.
Currently I have this setup:
A = Actor that increases in size
B = Actor to be destroyed on collision with A
Actor A is being spawned by a button.
Rule on A
-- Interpolate attribute: self.width to 200 (0.5 seconds)
-- Interpolate attribute: self.height to 200 (0.5 seconds)
-- Timer: After 0.5 seconds
---- Destroy this Actor
Rule on B
-- When actor receives event - overlaps or collides - with actor of type A
---- Destroy this Actor
For some reason the rule on B does not work, any ideas? Am I missing something?
If I change the rule on B to something like, Collide with actor of type A then this works, but destroy actor does not...
Any help would be appreciated, thanks guys!
Comments
If an actors interpolating it won't register a collision until it has reached the end of the interpolate.
You need at least one of the actors to have movable checked in order to register a collision.
You could do...
Make a timer every 0 seconds change size width to size width +1 (same for height) but you will need a rule to stop it growing too big.
Darren.
@DeepBlueApps thats a real shame about actors not registering a collision while interpolating, would have made this quite a bit easier!
I went with your advice and it worked perfectly, thank you!
I went with the following to replace interpolate and stop it growing too large:
If Attribute - self.width < 200
-- Timer - Every 0.1 seconds
---- Change Attribute self.width - self.width+10
---- Change Attribute self.height - self.height+10
Seems to work smoothly to me.
Thanks again,
Ryan
Just interpolate an attribute from one value to another and constrain your actor to this value - so the same interpolation but with collisions.