- Home /
Move Character Controller
Hello Unity3D.I have a problem with my character controller.My problem is that the character controller that i have assigned to the my characters whenever i add for to the character controller to move the character forward the character controllers moves forward but it doesn't stick the the position that i have assigned to.For example.My character is suppose to move forward the the opponent and then its suppose to stop by the opponent. but when i move the character controller from the new position the character controller starts from point (A).If anyone knows why this happens?Can you please tell me how i can fix this?Or a different way to move the character controller to the opponent smoothly?
Ps. Heres the Script var myTransform : Transform;
function Awake() { myTransform = transform; }
function Start()
{
target = GameObject.FindWithTag("Dummy").transform;
}
function Update ()
{
if(Input.GetKeyDown("c")) {
animation.Play("Genzu_Palm");
Instantiate(Genzu,spawn.transform.position,spawn.transform.rotation);
myTransform.rigidbody.AddForce(transform.forward * 500, ForceMode.Impulse);
Switch();
}
}
function Switch()
{
yield WaitForSeconds(2.5);
animation.Play("Genzu_Palm_Part_2");
myTransform.rigidbody.velocity = new Vector3(0,0,0);
Switch2();
}
function Switch2()
{
yield WaitForSeconds(.5);
animation.Play("Genzu_Palm_Part_3");
}
CharacterControllers are NOT meant to be used with rigidbodies.
I took off the rigidbody but now the character doesnt move at all.Do you know why?
controller.move(transform.forward * 400, Force$$anonymous$$ode.Impulse);
There is a Script in the Standard Assets in one of the CC folders, "FPS Input", use that as a base.
I figure out the problem by myself.But Thank You for your time =D
Your answer
Follow this Question
Related Questions
Ethereal Character Controller 2 Answers
Rigidbody vs. Character Controller 2 Answers
Rigidbody bumping when going down slopes 3 Answers
turn on and off character controller 0 Answers
Do character controllers work with dynamic gravity? 1 Answer