Jump to content

collisions


Rick
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...