Are there any controller scripts out there like the call of dutys once if so please inform
??
Thanks.
Are there any controller scripts out there like the call of dutys once if so please inform
??
Thanks.
This may help. There should be a decent FPS controller in there with working weapons code.
http://unity3d.com/support/resources/tutorials/fpstutorial
You’ll also find a few FPS character controllers here if you fancy modding your own.
to make a CoD like player controller its just a matter of adding the functionality to unity’s fps controller, if using the default capsule then you could get away with adding a animation to the camera of it moving to crouch height then activating it when the user presses the c button or what ever button you want then playin it backwards when c is pressed again to stand back up. For example:
var Crouching = false;
function Update()
{
if (Input.GetKeyDown("c")
{
if (Crouching == false)
{
Crouch("crouch");
}
else if (Crouching == true)
{
Crouch("stand");
}
}
}
function Crouch(action : String)
{
if (action == "crouch")
{
animation["Crouch"].speed = 1;
animation["Crouch"].time = 0;
animation.Play("Crouch");
}
else if (action == "stand")
{
animation["Crouch"].speed = -1;
animation["Crouch"].time = animation["Crouch"].length;
animation.Play("Crouch");
}
}