Rick Posted January 10, 2010 Share Posted January 10, 2010 If inside my lua object, I create another object with physics, say I create a cube and attach a physics body in lua code inside my editor, is there any way I can get a lua method to fire with the collision of that object I created? Ideally I would be able to piggy back on the editor object collision method. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 11, 2010 Author Share Posted January 11, 2010 Any ideas on how to do this? Any hack ideas out there even? Quote Link to comment Share on other sites More sharing options...
Josh Posted January 11, 2010 Share Posted January 11, 2010 You want a body to have a collision method the way a model does? 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 11, 2010 Author Share Posted January 11, 2010 I would want some way to get a collision method called for a physics body that I create in code inside an object model. An example might be the monster truck. You create the tires on the fly in the object code. If those have physics bodies around them, how can you tell if the tires collide with something? My example is a cube. I have an object that you drag into your scene. It creates a cube mesh that has a physics body around it. You can resize the cube in the editor and so the physics body needs to be created in the editor script. The physics on it works great, but I can't get a collision method called when that physics body collides with something because it's not the editor's object that's colliding, it's the physics body I create via script inside the object. I'm using this for a 3D platform game. For the platforms not having a collision function called is fine, but I'm also going to use it for triggers. When the character collides with this resizable physics body that is created in the script, I need a collision function called for it. Quote Link to comment Share on other sites More sharing options...
TylerH Posted January 12, 2010 Share Posted January 12, 2010 I was doing pretty much the same thing. I was creating a trigger entity a few weeks ago, and this was the same problem. To be honest Rick, every problem you are just now posting about, Vex came around and dropped because of stupid bugs like this (or missing features I should call them). Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2010 Author Share Posted January 12, 2010 I'm hoping that with this new found dll stuff I can get around this. I might be able to pass my physics body and world to the dll and be able get it to call a function in C++ that I can map back to lua. I'll play around with the idea. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 15, 2010 Author Share Posted January 15, 2010 So any ideas on this Josh? Would be really helpful to be able to get collisions somehow from bodies we create via lua code. 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.