Closed cmr624 closed 5 years ago
try using Input.GetKeyDown(KeyCode.LeftControl) at any time - ie inside InputVectorCalculation
That doesn’t work if it’s in FixedUpdate, it should only be in Update bc fixed update is called every physics tick, no? And we want every frame bc the system could miss the input
Yeah we use GetButtonDown for jump
Wasn't aware of this limitation. Let me make the following changes to rectify:
Moveable: active.InputVectorCalculation in called in Update, which sets a private Vector3 in the MoveController class
MoveController: uses most recent inoput vector for calculations
It’s weird tho, bc I looked it up and modifying the RB directly via input you want in FixedUpdate, but “event-like” polling (GetKeyDown) should be done in Update. If you want we can discuss tmrw / when we meet
Going to solve this by writing an Input class
Discussed. Resolved by careful design, rather than developmental base.
we should just take "jump" out of movement and add it as an ability. movement should be strictly how a player moves at all times when the component is active
Much smort. That’s a good idea I like it
Sent from my iPhone
On Feb 16, 2019, at 11:02 AM, Carlos Michael Rodriguez notifications@github.com wrote:
we should just take "jump" out of movement and add it as an ability. movement should be strictly how a player moves at all times when the component is active
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
fixed by making jump an ability, gives us more flexibility and separates from the movement system.
Since the Moveable class' .Move() function is called in a MoveController, it is called in a FixedUpdate because it is applying physics changes. We are also calculating the input vector during this fixedupdate, which is fine for an axis that directly apply forces to the RB but not for direct input polls like buttons being pressed down, this has led to some input loss.