Jump to content
Einlander

CSG Prefabs loaded by script have no collision.

Recommended Posts

Add an empty script to that CSG brush and then save it as a prefab. If you load that prefab with App.lua then it will be loaded with its physics body, assuming you set the shape in the Physics tab.

Share this post


Link to post

I'm starting to think that this bug is starting to fall under an unintended results category. You do not need to attache a script to the csg in the prefab to get physics to work. you must select EVERY SINGLE CSG in the prefab and set the shape. If you use the csg prefab in the editor, then it works as it should. If you do it manually in code then you must set everything manually beforehand.

 

This has the potential to became tedious. For example, I already have a fully articulated house created with csg's. The entity count is already over 100. Now i have to go back and add a physics property to every csg because there is a possibility that i might have the house spawn dynamically through code.

 

Hopefully this is a bug, if need be I can make a suggestion for all prefabs to have their default editor physics shape/states loaded when called from code.

Share this post


Link to post

The default behavior when brushes are loaded is for them to be collapsed into static mesh geometry, which does have collision but does not move.

 

I have not tested this yet and do not know exactly what you mean when you say "the collision does not load".

Share this post


Link to post

I'll post a video of what i'm talking about in a little bit.

 

Link for when the video is finished uploading and processed:

 

Share this post


Link to post

I attempted to recreate your situation here and it worked correctly. I think this is fixed.

test.zip

Share this post


Link to post
Guest
This topic is now closed to further replies.
×
×
  • Create New...