Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question How to add more controls in Starter Assets - First Person Character Controller

Discussion in 'Scripting' started by Only4gamers, Jul 26, 2021.

  1. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    313
    Hello everyone,
    How to add more controls in Starter Assets - First Person Character Controller? Like Firing Bullets.

    I added a new Action in Input Actions with name Fire.

    Then in my script I added:

    Code (CSharp):
    1. void OnFire()
    2. {
    3.      StartFiring();
    4. }
    But it's not working. What else I need to do?

    Thanks.
     
  2. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
  3. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    313
  4. edhalsim

    edhalsim

    Joined:
    Dec 19, 2015
    Posts:
    15
    Did you ever figure this out?
     
  5. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,882
    The overview of how to make starter code into your dream code:

    * start with starter code

    * read and explore the starter code, to see what parts are related to each feature

    * if you like the way the Jump button works but you want to add a Dash button,
    -- copy all the code and input actions you see in all the assets that are related to the Jump
    -- rename the new stuff you copied from Jump to Dash
    -- make it work by fixing any errors and changing the jumpy parts with dashy equivalents
     
    Kurt-Dekker likes this.
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
  7. edhalsim

    edhalsim

    Joined:
    Dec 19, 2015
    Posts:
    15
    I agree Kurt that this Basic FPCC is very good and I may switch to it, but I'm still wondering if anyone knows how to expand the Starter Assets - FPC to accept other inputs.
     
  8. rdxtalha103

    rdxtalha103

    Joined:
    Aug 30, 2022
    Posts:
    14
    Respected, I am using starter assets for my first person controller,
    When my first person collider with a trigger object, then jerky movement happens, OnTriggerEnter I am hiding that trigger gamebject, and also the joystick controller, complete person controller, mainCamera...
    And do joystick handle at position 0,0..Because when i active the person, the handle remains where I left...
    Everything works fine in the Unity but the jerky happens only in the android build happens.
    Is something wrong in the starter assets?
    And can you please guide how can I make it better?
    I have also write condition in the OnTriggerEnter that below statement canonly run once..
    Please guide.
    Thank you