[WIP] My FPS Game
- skr2000
- Contributor
- Posts: 169
- Joined: Thu Feb 02, 2017 8:23 pm
This was just hobby project but currently I'm planning to release.Rainsen wrote:I'm really impressed by your project, skr2000. How long have you been working on this game so far? Are you planning to release it someday or this just a hobby project of yours?
- ScoutMaster
- Contributor
- Posts: 13
- Joined: Wed Dec 27, 2017 12:39 am
Oggy wrote:Can you guide how to do lean peek?
I dont use mfps anymore but this should get u started with a lean peak..
note, make an empty object and place everything underneath it and add this script
Code: Select all
public bool canLean = true;
[Range(0, 100)]
public float leanAmount;
[Range(0, 100)]
public float smoothSpeed;
if (Input.GetKey(KeyCode.Q))
{
transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.Euler(new Vector3(0, 0, leanAmount)), Time.deltaTime * smoothSpeed);
}
else if(Input.GetKey(KeyCode.E))
{
transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.Euler(new Vector3(0, 0, -leanAmount)), Time.deltaTime * smoothSpeed);
}
else
{
transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.Euler(new Vector3(0, 0, 0)), Time.deltaTime * smoothSpeed);
}