I tried to attach a collision object (capsule shapes) to my game object, so that I can perform a raycast to detect a selection operation on it.
Everything works well if I added this game object to my collection, but the collision object is not there if I created the game object with a factory.
The first game object is added to the collection statically, the second one is created by a factory dynamically. Both of them shared a same .go file. The test project just has one single collection.
Thanks @britzl for the example, with more investigation on my game object, I found the collision object is really created with the game object, but it was not set proper scale with the game object.
My game object scale was set to vmath.vector3(100), so the collision object is too small to be found.
I tried to set scale to vmath.vector3(0.2) to the create game object to your example, seems the collision object is not changed too.
update: if I set the scale parameter in factory.create() function, it works for the collision object also, but if I use go.set_scale() to resize the created game objects, the scale is not work on the collision objects.
Yeah, you can’t scale collision objects at runtime still (they have been working on it afaik). If you need to scale the collision object you have to do it with factories to create entirely new versions and then cleanup the old ones.
Yes, the new feature of dynamic scaling of physics is still in progress, but there were other tasks that needs to be completed first, in order for it to be robustly implemented. Currently, the ETA is still unknown.