zomis Posted December 12, 2014 Share Posted December 12, 2014 I have created 2 boxes. One for the floor and one for the player. If I select the box, set it to character controller and character. Then it creates a collsion cylinder around the player starting from the pivot and up. But how come I can't change the offset with this config? Is character controller bound to use the pivot without the offset values? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 12, 2014 Share Posted December 12, 2014 You can't use the box as a character controller though.The character controller uses its own custom physics. When using a character controller I would not use a custom shape, since a cylinder will always be generated by the character controller type. A better approach is using a pivot which you set to type character controller. Then let the box be a child of the pivot when it would serve as a hitbox. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 12, 2014 Share Posted December 12, 2014 So the base of the character controller goes to the center of mass and for csg the center of mass is the middle. You can change the center of mass with http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetmass-r74. I believe with this you could get the character controller to be lined up correctly. I assume you are using the csg box as a filler, but it's a good thing to see that your characters should have that center of mass at it's feet so things line up with the character controller. Quote Link to comment Share on other sites More sharing options...
zomis Posted December 12, 2014 Author Share Posted December 12, 2014 I wrote this before Rick replied: Why would it not be possible to bind a box(the object, not the physics->shape) to a character controller? What is the difference between that and all tutorials importing a model and binding it straight to the controller without using the pivot/child method? I understand what you mean with the pivot/child, but is offset disabled when using character controller? I don't understand how/when offset work/don't work. To rick What I thought was binding to the pivot is really binding to the center of the mass? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 12, 2014 Share Posted December 12, 2014 Apparently when you have a pivot and set its type to character, the center of mass lies at the bottom of the cylinder. But like Rick said: can't you change it with the command? Quote Link to comment Share on other sites More sharing options...
Rick Posted December 12, 2014 Share Posted December 12, 2014 If I select the box, set it to character controller and character. Then it creates a collsion cylinder around the player starting from the pivot and up. What pivot? You said you made a csg box and made it a controller. If that's all you did then there is no pivot involved. Whatever you make the character controller will be where the character controller aligns it's bottom to the things center of mass. So I'm not sure where this pivot is involved? Quote Link to comment Share on other sites More sharing options...
zomis Posted December 12, 2014 Author Share Posted December 12, 2014 Maybe I'm asking the question wrong. From what I understand from Rick, The cylinder(View->show physics) in the image is bound to the center of mass of the Box(primitives->box) when using the character controller. This can be changed using the Entity::SetMass function. But when is the "Shape offset" values in the editor used/not used? Shouldn't offset offset the center of mass too? From what I understand/have tried the offset values is only used with 'rigid body'. But then what more is not used when using the character controller? What pivot? You said you made a csg box and made it a controller. If that's all you did then there is no pivot involved. Whatever you make the character controller will be where the character controller aligns it's bottom to the things center of mass. So I'm not sure where this pivot is involved? Is the x in the box model not the center of rotation? Is that not also a pivot? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 12, 2014 Share Posted December 12, 2014 But when is the "Shape offset" values in the editor used/not used? Shouldn't offset offset the center of mass too? From what I understand/have tried the offset values is only used with 'rigid body'. But then what more is not used when using the character controller? Well since the character controller is a special object, it wouldn´t surprise me if the the offset values are not affecting the controller in the same way as for a CSG box for instance. Not sure though. Personally I never try to adjust physics to a mesh, but rather the other way around. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 12, 2014 Share Posted December 12, 2014 Is the x in the box model not the center of rotation? Is that not also a pivot? It's not an LE pivot (LE has an entity type named pivot). It can be thought of as a pivot point but because LE has an actual entity called a pivot that you can make, it's confusing to call it a pivot. Sounds like you did not make an LE pivot. You just made a csg box. So no, that center point of the box is NOT really considered an LE pivot. That center point is the center of mass. It's the point every model has, I guess, that LE uses to place the bottom of the character controller. As far as I know once you set the type as character controller, then those other settings don't do anything. The only exception being the rotation one (don't recall the name off the top of my head). That rotation one can be handy if the model you imported was facing in the "wrong" direction for LE (not facing down the positive z axis). You can use that rotation setting to adjust this, but it's best to just export the model facing correctly for LE if you run into that case. 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.