Problem when colliding with a "custom" rotating actor. Maybe a bug?

MarkOnTheIronMarkOnTheIron Member Posts: 1,447
edited November -1 in Working with GS (Mac)
I was working on an update for my last game "A Plinky Game!". In one of the levels I made an actor rotate from one end using rules and change behaviors but I got strange to none collision.

It's something wrong with my code or it's a bug? Here's what I did:

The scene has gravity.

On the rotating actor:

Movable set to false
An animate attribute with 4 frames

- Timer
Every 1 second
Change attribute self.myPosition to (self.myPosition+1)%6 <-- That's to get a value between 0 and 5

- Rule
When attribute self.myPosition = 0
Change attribute self.PositionX to 25
Change attribute self.PositionY to 240
Change attribute self.Rotation to 120

- Rule
When attribute self.myPosition = 1
Change attribute self.PositionX to 55
Change attribute self.PositionY to 240
Change attribute self.Rotation to 60

And so on until self.myPosition = 5 and after that the value get back to 0.

On the colliding actor (the ball):
- Rule
When overlap or collide with actor of type Laser
Change attribute self.iamDead to 1

- Rule
When attribute self.iamDead = 1
Destroy this actor

What happens is that with those rules everything apparently works fine and the actor rotate exactly as I meant it to be, however the ball collide only with the invisible "ghost" of the rotating actor that stay fixed on the coordinates relative of the 0 value of myPosition.

I tried to change the rotating actor to movable and using constraint attribute instead of change attribute to avoid it to fall but it seems that the ball collide with a falling invisible "ghost" of the rotating actor.

I don't know if I explained the problem well and I can't post an example now since I'm at work, but if someone has an idea of what is happening his help is welcome.

Comments

Sign In or Register to comment.