Check whether Object is an Actor ingame

Hi everyone,

I’m trying to find a way to check, whether an object is marked as “Actor” at runtime. I can’t find it in the documentation. Does anybody know if this exisitsts (maybe undocumented)?

Thanks for your help.

Huh, I’m not sure. Why do you need to check to see if it’s an actor, though? Also, if it exists, it’s going to be as a Python function.

I try to detect collision between Objects. It’s for a simulator so everyone should be able to use their own enviroment. But if you forget to mark the object as Actor, the collision won’t be detected and this way my script will never stop to move the players arm. So I want to check this before I fire this script

I do not think there is an attribute for that.

But you can check with the dir() function at the KX_GameObject.

I completely forgot about the dir() function. Thank you Monster.

There seems to be nothing for that. It’s missing like a ‘size’-attribute.
But I think there are solutions for my problem:
“Nice” solution: Checking for collision with non-Actor Objects. But I have no clue how to achieve this easyly (and without ruining the performance).
Really dirty solution: Instead of just using a Ray-sensor I can combine it with a Radar-sensor. The Radar-sensor only detects actors and the Ray-sensor can return the hitPosition. This way I can only collide with actors.

There are no Python-bindings for the Bullet-libraries, am I right?

What i believe to understand is that we have a currently incomplete wrapper for the Bullet api. Therefore, unfortunately you are correct.

I o not really know what you want to do.

Just for information: the Radar sensor is a heavy sensor similar to the ray sensor. I haven’t compared them yet. So I do not know which one is faster.

If it is just for a warning, you might want to document this as requirement and let it go. If users ask why it does not work, show them your FAQ’s ;). Sounds silly, isn’t it?

You could just add a variable to all ‘actor’ objects. If you know which objects need to be actors or if they all share a name, you can do it quickly and easily with Python.

I tried the combined sensors and it doesn’t affect the performance too much, so I will propably stay with this solution (although I don’ really like it).
Thank you for your help anyways

Let’s hope for better Bullet accessability for the future.