Jump to content
  • 0
TYFKO

Character Controller Physics

Question

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

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

If you call camera:SetDebugPhysicsMode(true) it will show the physics shape and give a better view of what is happening.

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0

I have a similar problem as well, would really like to know where this cylinder collider comes from and how to change its shape or size

Share this post


Link to post
  • 0

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

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

×
×
  • Create New...