Question by
loscos · Apr 18, 2018 at 01:37 PM ·
movementfirst-person-controller
FPSController walk with mouse
Hi there !!! This is my first post. I'm trying to make FPS walking with mouse button instead that using up arrow key. I'm able to use transform methods to move the GameObject where I want, but I'm wondering if is possible trigger the same event of up arrow key. I did it with jump adding this lines in FirstPersonController.cs
public void doJump()
{
m_Jump = true;
}
And recall it from antoher script
if (Input.GetMouseButtonDown(1))
{
hero.doJump();
}
Sorry for the stupid question, but I can't find answer searching, I need to get deeper in Unity. Thanx ! Marcello
Comment
Answer by loscos · Apr 20, 2018 at 07:21 AM
Usually I prefer work with script, but a solution via editor will be nice too :)