Overlap or collide when changing size
stirem
Member, PRO Posts: 2
I know the "overlap or collide" rule doesn't work when actors size are constrained. But I found a workaround. I got a Player that changes size when moving. The Enemies are also changing size when moving. So I constrained the left, right, top and bottom of the Player to attributes. This is also done with the enemies. So now I can say: "when left side of Player is less then right side of Enemy and top of Player is greater then bottom of Enemy etc. --> Player gets hurt". This works well for the Player and the Enemy when they crash. But my problem is when using the Gun. My Player has a Gun that spawns Bullets. Since the Enemies sizes are constrained, the "overlap or collide" rule doesn't work with the Bullets. I found a workaround for this too. When I use a timer on the Enemy and say it should change size every 0,5 seconds, the "overlap or collide" rule works with the Bullets. BUT it isn't consistent and the bullets doesn't always work. The workaround I use to crash Player and Enemy is difficult to do since I can't use game attributes when there are so many of them. (When crashing Player and Enemy, Player uses game attributes and Enemies use self attributes to do overlapping)
Anyone got ANY tips for this issue?
Thanks (^_^)
Anyone got ANY tips for this issue?
Thanks (^_^)
Best Answer
-
Photics Posts: 4,172Here's a trick that you might want to try...
Chuck the constrain behavior into a short timer... fast enough so that most people won't notice, but slow enough to allow the physics shape to update.
I'm not sure if this trick will work for you, but that's what I used to fix collision problems with constantly changing actor sizes.
Answers