- Home /
How to make the character strafe while running?
Is there any way to give the character the ability to strafe left and right without changing the whole way the third person controller works and without having a seperate object? I want the character to be able to do this while running and not lose any speed. An example of how fast my character moves:
http://www.youtube.com/watch?v=IWrC60yS5OQ&feature=plcp
Thank you in advance,
Regards,
DJScriptify
Answer by electricsauce · Aug 31, 2012 at 03:20 AM
What script are you using?
If you are using transform.Translate(Vector3.forward Time.deltaTime moveSpeed);, perhaps you could try something like:
transform.Translate(strafeSpeed Time.deltaTime, 0, Time.deltaTime moveSpeed); where strafeSpeed is positive or negative depending on your strafe direction.
Got it working, thanks for your help :)