Jump to content

Collision for characters


PerEspen00
 Share

Recommended Posts

Is there any way to get add more collision for character controllers? Maybe create a box in the start function or something to make a bigger collision than the default cylinder(which really should get fixed).

 

So I'm looking for a piece of code to use in the start function of my creature script so that I can create a box which will act as that creatures collision box for sword hits and general physics collision in the game.

 

Any help appreciated!

Link to comment
Share on other sites

There are many ways to detect if a sword hits a creature. Since you're using Lua, the easiest is probably CollisionTrigger.

 

For general physics collisions, you could parent a box to a creature. Check out the code examples in the Entity docs, specifically SetShape and SetParent. However, the navigation system will ignore it so you might not get the effect you're hoping for.

Link to comment
Share on other sites

For general physics collisions, you could parent a box to a creature. Check out the code examples in the Entity docs, specifically SetShape and SetParent. However, the navigation system will ignore it so you might not get the effect you're hoping for.

You can't attach collider as a child, this will break physics.

Link to comment
Share on other sites

The problem is with recast/detour. The navmesh needs certain data like character height/width/stepheight to determine if a path would be feasible, how close a path should be around walls, etc... If you had multiple character sizes then you would need multiple navmeshes - which means characters on different navmeshes would have no knowledge of each other. While I agree that having access to certain variables to control the character cylinder size would be ideal, then it would be an issue with navmeshes and what is passed to it prior to creation. The easiest solution (especially for 90% of users) was to hardcode this. Maybe one day Josh will allow us to control these variables for the controller and the navmeshes, but I would be surprised since this has been requested since LE3 with no luck.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

  • 2 weeks later...

The melee script uses a raycast. Box raycasting is used on the character to collide with his arms, legs, head, etc. This is in the monster and soldier AI scripts.

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

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