I want to create ability like roll or jump to a mouse position with top down style. What I have done so far, it to mimic the firewall ability to target aoe but instead spawn prefab I use change position. For a roll ability I can roll but the character is go back to last move click position by walking what is wrong with it? did I miss something?
I am using mouse click player control, character controller, and mecanim animation.
You could either block the player controls during Player Actions in your battle system's settings, or manually block the player controls in the battle event used by your ability through a Block Player Control node (but don't forget to unblock the controls at the end of the event).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I want to check my target (raycast from the screen) layer = "enemy" or "ground" or something else like wall etc.
or any other solution for this kind of problem?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Next, use a Check Object Layer node to check for the first layer on the found object you stored the game object into (the layer value being the index of the layer, e.g. layer 5 would be 5). The failed slot connects to another Check Object Layer node to check for the next layer, etc.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I think the best solution would be using the battle event that animates your attack. Similar to the game tutorials, you'd have a move to target battle event that handles this - but instead of just waiting for the move to finish, you'd do a loop in the event until the target is reached or it was cancelled due to player input.
The loop uses a Wait node with 0 second wait (i.e. waiting for 1 frame), which is connected to your checks (e.g. checking distance to target or some player input that would cancel the attack). Failing checks are connected back to the Wait node.
You can cancel the action using an End Battle Action node.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Is there any better solution for this problem?
You can e.g. use NavMesh - the Change Nav Mesh Target node can be used to tell an agent where to move to.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!