[SOLVED] Senseless sensor trouble

Almakos

  • Posts: 632
Hey guys,
For some time already I am failing to make sensor to work.
I've got an explosion with circle collision shape set to be a sensor. Sensor is using same collision group as explosion actor.
Then I created behavior as in attachment, but I get no feedback printed in the console.
Is there any special way I should work with sensors?

Also I cannot see collision circles when enabling debug draw, should it be like that?  :-\

Thanks.

« Last Edit: June 14, 2012, 01:05:24 am by Almakos »
Fishing Fantasy Trailer


Future Freak

  • Posts: 413
Does it trigger a collision if you untick the sensor option? 

I know I've had issues in the past with sensors not triggering, but they did when they weren't sensors.  I ended up coding the gameplay differently (back then) to not need sensors.   (although I am about to add a sensor to some of the game elements in my game soon, so I'll let you know if I run into problems)

Almakos

  • Posts: 632
hm,....in fact they don't collide at all and there is no collisions drawn even after I unchecked sensors.

I've created new actor for explosion, set everything same way as before and it works, and collision shapes are drawn. So that was simply a bug, everything works now.
Also I noticed, that for old explosion I couldn't move collision shape with my mouse while editing and for new one I can. Something just broke for some reason and I was hitting a wall with my head for two days )))

Thanks a lot for your help =)
Fishing Fantasy Trailer


froz

  • Posts: 250
Watch out when you are changing an actor only frame/animation. If your new frame (that replaced the old one) has different dimensions, origin point and collision shape don't update. So you can have origin point not in default center of the image and collision shape can be different (including the shape of the image shown in the collision tab).

For this reason when changing animation of your actor to something with other dimensions, best way is to delete animation and make a new one.

Also remember that if you set physics for actor to "no", collisions are also disabled. And ofcourse triple check the group of the actor :).

Almakos

  • Posts: 632
Thank you. That is very useful info indeed. Wish I knew that before.
Probably I accidently grabbed not native frame into my animation sequence, that's why collisions messed up.
Fishing Fantasy Trailer