martyj Posted November 9, 2015 Share Posted November 9, 2015 When an entity uses a character controller the physics is always a cylinder. Even if we set the shape problematically. The problem is that the shape is too tall. We should have the ability to add our own shape to a character controller. Another problem is that there is no way to customize the offset. The current position of the cylinder is at 0, 0, 0 for the character. This sets the position to be half of what the shape is. https://i.imgur.com/GjVwC0j.png Notice how the physics shape is in the air compared to the bottom of the box. Quote Link to comment Share on other sites More sharing options...
Rick Posted November 9, 2015 Share Posted November 9, 2015 For your 2nd note about the offset generally you'll want your "origin" from your model in the model app you use to have it set to the bottom. If you go with csg then I think you can set that in code if you make it an entity. For your 1st question this has been brought up many times but it's because of the navmesh. In order to calc where something can go the navmesh generation needs to know the size of that something. That generation is done in the editor at design time for 1 size. If you had different sizes you'd need multiple navmesh's for each different size physics body. It's not impossible but Josh has said for now this is what we have. There are various ways you can work around this depending on the situation you have. Clipping is something we generally just have to deal with though. Your other more advanced option is to not use LE's navmesh stuff at all and make your own. Before LE many people used A* for path finding and put their own node system in. Obviously this is more advanced stuff to do though. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted November 10, 2015 Share Posted November 10, 2015 "The problem is that the shape is too tall. We should have the ability to add our own shape to a character controller." That's right that's why I wrote my own character controler for my Project, making the shape as I want, adding real crouching or lying or swimming shapes. And using the Physics functions to move the entity.(addforce()...) I make a sphere as foot and add a body as child, you can do the body as big as you want, adding the shape you wantThe result is not as exact as the original character controller but it's very playable. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 10, 2015 Share Posted November 10, 2015 You will encounter a lot of small problems with physics if you try to write your own. It's not an easy thing at all because player movement doesn't really follow real physics. My best advice is to just accept the discrepancy between the player height and your model and move on to make your game. There's tons of small little things like that in AAA games, and they just design the game to hide small "flaws". Crazy Scorpion uses a much shorter character model, but it works fine: http://www.leadwerks.com/werkspace/page/viewitem?fileid=547820610 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...
Marcousik Posted November 21, 2015 Share Posted November 21, 2015 I uploaded today a demo-map to this subject 'shaping and character controller' with FPS view that I would like to use in future project. If interested look at this: http://www.leadwerks.com/werkspace/page/viewitem?fileid=559812597 You can try to crawl/crouch under the constructions, at a point you have to crawl to do this or the crouch shape won't allow you. or this one, same own character controller in open world demo http://www.leadwerks.com/werkspace/page/viewitem?fileid=583447681 enjoy! 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.