How to Get Collision Object of Instance?

How can I reference a component of a spawned game object (i.e., a dynamically created game object instance)? This doesn’t work, since “message.other_id” is a hash and not a string…

msg.post(message.other_id .. "#collisionobject", "disable")

Bryan

message.other_id is a hash, not a string, so .. won’t work on it. Instead, you can use it to construct a URL to a component like so:

msg.post(msg.url(nil, messsage.other_id, "collisionobject"), "disable")
5 Likes

Thanks, this is perfect!

Sounds like I need to continue poring through the documentation. :slight_smile:

Thanks again,
Bryan

3 Likes

This is mentioned in the manual on factory components:

But we should probably also add this to the message passing manual.

1 Like