Jump to content

Character Controller Physics


TYFKO
 Share

Go to solution Solved by macklebee,

Recommended Posts

Hi,

First of all I´m completely new to both coding and this editor, be gentle

I read through the tutorial documentation and played around a bit with the tutorial "worlds", now I wanted to create something on my own with this basic knowledge but I have already encountered my first problem. I created a cylinder that is supposed to be my character entity for now. My movement script and the camera for it work, but only if I set the cylinders physics mode to character controller. Now the problem is, whenever I put it to character controller, then the cylinder will just sink a little bit into the floor. Movement still works, but it seems as if part of the floor is not solid?

Here´s a screenshot of what it looks like.. Probably it´s a stupid question but I´d still appreciate any help!

Oh and is there any place where I can take a look at completed (well documented?) scripts to learn?

20180731102829_1.thumb.jpg.bd27fe3d2f098536c1550e74e751c337.jpg

Link to comment
Share on other sites

  • Solution

The problem with using a CSG cylinder instead of a model is that its origin is at the center and not at the base (or the feet like with a character model). If you look at the SetInput() example, notice that the 'visiblecapsule' cylinder is set as a child to the pivot (which is the actual player) and the cylinder's center is positioned up 1 meter from the ground.

  • Thanks 2

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

  • 1 year later...

The cylinder shape is used when you use CharacterPhysics as the physics mode so you can use the automatic pathing for characters.  You can check out the SetInput documentation for sample code (as macklebee also linked above).

Unfortunately you can't change cylinder shape or size for character navigation but it should work fine for smaller or larger characters.  Remember that the player won't be able to see the collision details and they won't notice small size differences.  On the other hand, if your game has giants or mice that need to get in small spaces or something, Leadwerks pathing won't be for you.

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