Hello,
I mostly purchased this course for the inventory, stats, ability, and combat aspects. In the past i have already made point to click RPG type games. However this type of “ActionScheduler” that they are introducing is new to me from other games I have made. And admittedly, I have gone a more, bloaty, if/else route in the past. My problem is this: I am trying to adapt the movement mechanics, point and click, into WSAD movement. So far through the lecture I have adapted everything perfectly. Moving, camera follow, being out of range of attack, and manually moving myself in range, and then being able to attack, etc. But my problem comes with the ActionScheduler, specifically for starting and cancelling an action… I cannot seem to figure out how to use my WSAD input as a means for cancelling an action.
I know that it is monobehavior but i can’t seem to wrap my head around it. The WSAD is simple, it is:
moveForwardBack = Input.GetAxis("Vertical") * speed;
moveLeftRight = Input.GetAxis("Horizontal") * speed;
Vector3 movement = new Vector3(moveLeftRight, 0, moveForwardBack);
movement = character.rotation * movement;
character.GetComponent<CharacterController>().Move(movement *
additionalSpeed * Time.deltaTime);
I know there must be some simple solution but in my head it seems so silly to create a method around this simple movement simply for the sake of cancelling the aciton. However without the cancellation of the action, the only way for me to cancel combat, is to move out of range and delete my target. I know this will pose problems later with animating and switching targets as well so I want to nip it in the bud.
If you are reading my code and wondering why it is written the way it is, it is because I have a really nice camera follow that uses right mouse to pan, and has auto snapping, lets character move in the direction it is facing with auto rotation of character, etc. It is a really nice camera, and its part of the reason I am sticking with WSAD.
Can anyone provide any insight or direction to my problem?