Suomis Posted January 21, 2016 Share Posted January 21, 2016 Hi! I'm quite a newbie with LE, but I've gone through all the non-lua-tutorials. I'm making a map which I try to use all the basic features in to learn their proper uses. I'm currently struggling with making a pickable crate. It falls through the floor every time I set it's mass to anything but 0 and I can't seem to get it to collide with the player either. The crate is crate_small.mdl expanded to 300% size with physics set as Rigid body and collision as Prop. So far the only script attached is impactnoise.lua. The floor beneath is a standard box with no scripts. It's set as Rigid body and Scene with a mass of 0. It's also a nav obstacle and the material used is greygrid.mat. What I would want the crate to do, is for it to be located somewhere in the scene so the player has to pick it up and use it to get onto the ramp and to the control panel. Thus, I need it to collide with the player and environment and it needs to be pickable. I have 3 screenshots attached: Sieppaa1.png = picture of the scene with the crate located where it needs to be lifted by the player. Also includes physics of crate. Sieppaa2.png = Scripts of the crate Sieppaa3.png = The floor's physics There might be some brainfart on my end since I'm new, but I can't seem to figure it out. Any help will be appreciated. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Josh Posted January 21, 2016 Share Posted January 21, 2016 Just drag the prefab into the scene, found in the prefabs folder, and it will work. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted January 21, 2016 Share Posted January 21, 2016 Why doesn't the model have a box physics shape on it when I open it in the model viewer? What did you do different with the prefab to get that shape? Quote Link to comment Share on other sites More sharing options...
Josh Posted January 21, 2016 Share Posted January 21, 2016 This was actually created before that system was even in place. The prefab has a setting to use a box around the object. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Suomis Posted January 21, 2016 Author Share Posted January 21, 2016 Just drag the prefab into the scene, found in the prefabs folder, and it will work. Thanks! Now that you say it, it's the obvious thing to do, but for some reason it didn't even cross my mind to use the prefab instead of the model. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 21, 2016 Share Posted January 21, 2016 Your other option, moving forward with other things, is to open the mdl (dbl click it) and in the model viewer add physics box to it and save. Then you can drag it in and it'll work right. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 21, 2016 Share Posted January 21, 2016 Yeah, I think in the future we're going to eliminate the separate "Prefabs" directory and store them with the model, since they are almost always just based on one model. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted January 21, 2016 Share Posted January 21, 2016 I guess you'd have to weigh if that makes things easier to understand for users vs removing flexibility, because it may remove more advanced use cases. 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.