Running AIM problem

Support for MFPS 2.0
Post Reply
User avatar
Suraj02
Member
Member
Posts: 14
Joined: Wed Jul 08, 2020 4:39 pm

Sat Sep 05, 2020 2:12 pm

Hey I want my character to AIM while running. In Code's description, it says just remove "!controller.run" of the condition I am not getting where is "!controller.run" The hole code start with controller and ends with Running. i try to delete "!" and replace it with "=" but in idle aim is not working.
Please help me to edit it..

Code: Select all

public bool m_CamAim
    {
        get
        {
            bool can = false;
            if (CanAim && controller.State != PlayerState.Running)
            {
                can = true;
            }
            return can;
        }
    }
    /// <summary>_
    /// determine is we can reload
    /// TIP: if you want to have to shoot when running
    /// just remove "!controller.run" of the condition
    /// </summary>
User avatar
Suraj02
Member
Member
Posts: 14
Joined: Wed Jul 08, 2020 4:39 pm

Sat Sep 05, 2020 2:39 pm

public bool m_CamAim
{
get
{
bool can = true;
if (CanAim && controller.State == PlayerState.Running)
{
can = true;
}
return can;
}
}

Hey, I just Changed the code like that, and currently working as i wanted. Is it the correct procedure? Please let me know
User avatar
Lovatto
Admin
Admin
Posts: 1549
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Sun Sep 06, 2020 12:18 am

With that change, you probably wouldn't be able to aim when the player is idle or walking,
what you need is:

Code: Select all

public bool m_CamAim
    {
        get
        {
           return CanAim;
        }
    }
User avatar
Suraj02
Member
Member
Posts: 14
Joined: Wed Jul 08, 2020 4:39 pm

Sun Sep 06, 2020 2:06 am

Working like a charm... Thank you that's what i wanted to do. Only "CamAim" thank you

but it seems both the codes working https://vimeo.com/455191999
User avatar
Bunny
New Member
New Member
Posts: 1
Joined: Wed Oct 28, 2020 11:20 pm

Wed Oct 28, 2020 11:31 pm

Hey , i am a Complete Beginner to Coding and this player controller script have 900 lines of code . i need aim while run . i dont understand where should i add this code
public bool m_CamAim
{
get
{
return CanAim;
}
}
i need help
Post Reply