Ok, so I’ve been trying to get a property status from an object that a ray collides with.
So this sounds a little confusing, but basically:
- object1 shoots out a ray
- the ray hits object2 with the property ‘boolean’
- object1 stores the name of the hit object (object2)
- object1 finds the name in scene.objects(stored_name) and assigns this to ‘status’
- if status[‘boolean’] == True —> do stuff
However the line ‘status = scene.objects(stored_name)’ does not work
Why can’t I just use scene.objects[‘object2’] ?
because there will be more than one ‘object2’.
Use  instead of ()
This brings up a CList key error
using ordinary brackets brings up CList Value error (not callable)
So to give it a little context and make it possibly less confusing I created a small (not working) .blend:
president_distress.blend (497 KB)
The ‘president’ = object2
The ‘guard’ = object1
I’ve also annotated the script
In short (without using python necessarily):
I need one object (object2) to send out a distress signal
I need the other object (object1) to respond by moving to the distressed object.
If anyone could come up with a solution for getting scene.objects to work or another alternative such as suggested above that would be greatly appreciated!