I am trying to get my character controller to move over the surface in such a way it rotates with the curves of a surface.
I figure I need to raycast and then use that information to match the rotation with my controller?
Is there a better way?
Help please
Im also starting to think a character controller might not of been the best idea. I am going to try the method of making a car (although I guess you could say i want mine to control more like a tank in the sense it doesnât slide or anything unless put to extremes (and i also want to when those extremes are met be able to create a death).
As far as realism goes, I am not looking for something totally realistic. Think for a golf buggy with 1 speed. Nothing crazy, always on the ground and not going fast enough to skid etc.
Also I purchased your vectrosity and have a quick question (related to a sample not the product lol) in the one where you make all the spheres appear randomly how do you ensure none are overlapping? I looked at the code and it looked like it was somehow automatically doing it.
I have been playing with the wheel colliders and canât seem to set it up in a way which more mimics the character controller (I basically want to set it up so it works similar to the character controller except rotates with the slope of the land.
I also wondered if was possible to someway say have the character controller on the front wheels, then somehow many the chasis and back wheels a rigid body then lock it into the contoller to limit how it can react and just âdragâ it around and it would automatically give the effect i am looking for. Althoughi have no idea how to do that or if it is possible. I tried attaching a rigid body but it floats further away as it hits things.
Doesnât sound like you really need physics for that; just a box collider for collisions.
I didnât bother to check at all actuallyâŚif any two spheres overlap when instantiated, the physics engine will take care of it. If I did want to check, I would use Physics.OverlapSphere.
Nah, just do it procedurally. i.e., fake it. Thereâs a post around somewhere about Off-Road Velociraptor Safari, where they say the vehicle is actually implemented basically as a hovercraft (the wheels are just for show), and there are a number of topics about hovercraft around.
I am making 4 raycasts around the object which I use to find the angle and now it stays nicely lined up with the surface.
However since I am manually changing the angle of the object it is a bit jerky. How would i fix that? I am thinking I need to use transform.rotate but how can i use it in terms of saying I want the object to rotation.z = certain value with a line like transform.rotation.eulerAngles.x = rotationAmountSurface;
Also I am still using a character controller, but I donât like the shape of the collider. However I am unsure how to change to using a box collider in terms of moving it.
Currently I used var controller : CharacterController = GetComponent(CharacterController); to define a controller and then controller.SimpleMove to move it forward transform.Rotate to rotate.