Brutile Posted May 29, 2014 Share Posted May 29, 2014 Is there a way to set custom heights for the character controller? I have a vent I want to be able to crouch under, but the default controller doesn't go low enough. Quote Link to comment Share on other sites More sharing options...
tjheldna Posted May 29, 2014 Share Posted May 29, 2014 In the SetInput command which is what you will use to move your character controller, there is a crouch setting. I have never used this however. SetInput(float angle, float move, float strafe=0, float jump=0, bool crouch=false, float maxaccel=1) Quote Link to comment Share on other sites More sharing options...
Brutile Posted May 29, 2014 Author Share Posted May 29, 2014 I know about the crouch setting, I want to change the heights for standing and crouching, because even when crouching, the gap is too small to fit under. And if the gap was made bigger, it would look very out of place. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted May 29, 2014 Share Posted May 29, 2014 Actual LE3 cylinder is not adjustable and fixed. The other problem is with bigger characters, as collision will be too small i don't know if some day it will find a fix, that's pretty limited as Unity for example proposes any shape size you want for character controller. Some solution in C++ , use a custom physic shape you made for collision, and calling navmesh functions access to navigation coordinates to manually make move yourself the physic shape. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Brutile Posted May 29, 2014 Author Share Posted May 29, 2014 That's quite limiting... Hope it gets updated some day. It's kinda limiting. I had an idea, now I have to change it Quote Link to comment Share on other sites More sharing options...
Rick Posted May 29, 2014 Share Posted May 29, 2014 I had an idea, now I have to change it Welcome to game programming There are usually a lot of smoke and mirrors in games. There might be a workaround to get this same effect if you describe more your specific situation. Quote Link to comment Share on other sites More sharing options...
josk Posted May 29, 2014 Share Posted May 29, 2014 Maybe turn off collisions but keep the player on a set path while going through the vent. Smoke and mirrors all over in my code. Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
catch22 Posted May 29, 2014 Share Posted May 29, 2014 So, I'm new. Hopefully everyone knows that. I've done virtually no scripting for LE yet. That said. It seems unlikely you couldn't adjust the size/shape of a cylinder by manipulating it's properties. But alas, newbie here. If that's truly the case why not try constructing a new cylinder when you crouch, and apply that to your model as the physics shape? Do the same for standing back up? http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/shape/shapecylinder-r519 Quote Coding for Christ. Link to comment Share on other sites More sharing options...
Einlander Posted May 29, 2014 Share Posted May 29, 2014 The character controller has a non modifiable cylinder, so you can't replace it as far as lua is concerned. A solution I to manually create your own character controller. I have a feeling more people will end up doing this as they start making games that don't exactly fit in the COD FPS mold, or as they use non human characters. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 30, 2014 Share Posted May 30, 2014 However creating your own character controller isn't all that easy. Getting it just right is a pain. 1 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted May 31, 2014 Share Posted May 31, 2014 However creating your own character controller isn't all that easy. Getting it just right is a pain. Not a pain and should allow lot of possibilities and any custom collision need. Using simple physic shapes you move by hand and change depending on position (crouch, crawl , stand) should work and will allow any shape for any character/monster/robot size, using navmesh point navigation it should work. Actual LE3 character system is very limited and too much restrictive, if you want better and non limited, like always you will have hard work to do. 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted June 1, 2014 Share Posted June 1, 2014 Give it a try then YouGroove There are some details that make getting things just right a pain. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 1, 2014 Share Posted June 1, 2014 ahhhaha , how do you think other people done in Unity or other engines ? Unity default character is good to test and prorotype, not so good character controller, once you need a better one, you need to code and in other cases use real physics instead of faked one. What are the details stopping you ? I would have used a simple capsule physic i would move using SetPhysicsPosition, i would rotate, and i would cancel physics unwanted rotation velocity using SetOmega(). Than crouching or crawling i would just Hide the capsule and show/activate a different physic shape like a smaller capsule for crouch and some horizontal aligned capsule for crawling. It's only be able to deal with all available physics functions. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Brutile Posted June 1, 2014 Author Share Posted June 1, 2014 I agree YouGrove, I've done custom character controllers in Unity, so maybe I'll try to make one in Leadwerks. Couldn't you just scale the capsule? or do you have to use multiple physics shapes? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 1, 2014 Share Posted June 1, 2014 Personnaly with LE3 i would go for switching multiple physic shapes (show/hide, Collision on/off) , to avoid any potential LE3 physic shape resize bug or problems Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Brutile Posted June 1, 2014 Author Share Posted June 1, 2014 I kinda want to try it using resizing... See what happens. I'll most likely just fall through the floor a lot. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 1, 2014 Share Posted June 1, 2014 So do it Yougroove and show us your sweet controller 1 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted June 1, 2014 Share Posted June 1, 2014 I'm not doing some FPS game right now, there is so much FPS games The best way used today i think used in games is a mix of ragdoll physics and animation system, this way any collision limb of character never passes throught floor , or character can pass under low obstacles crawling. Perhaps some objects physics attached to bones and not colliding between them (see pic below) Otherwise, it's using physics and tricks indeed , you can also google or ask on other forums to see how people manage that. It's only lot of work and lot of tweaking and tricks. Video example : Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Marcousik Posted August 2, 2015 Share Posted August 2, 2015 Well I don't know if somebody is still interested in this, but I had to work today on this, and I have to say making just a Sphere and add something modified script FPSPlayer.lua with Rigid Body - Prop and Mass=10 work fine. So you get a Shape-Collision just as big as your Sphere is. Had to change the commands function in FPSPlayer.lua and add something with addforce(). 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.