This code was written for Fungus 2.x should work with the latest version but has not been tested. Also I was not happy with the abstract Walker class but it seemed to be the only way to get this to work at the time.
- FaceDirectionCommand.cs - creates a new Fungus command block that sets the facing of a Walker
- WalkToCommand.cs - creates a new Fungus command block that walks a Walker to a specific spot
- Walker.cs - abstract class that implements the Walker logic
- SpaceDudeWalker.cs - example implmentation of a Walker (for the space dude in LostInSpaaaace)
- For your character create a new script and add it to your character. The script should extend Walker NOT MonoBehaviour. Use SpaceDudeWalker.cs as an example.
- Add empty Gameobjects to your scene as targets to walk to
- Add your character to the scene
- In a fungus flowchart add the "Walk To" command. Set your character as the Walker and use one of the empty Gameobjects as the target.
And that is it.
Note: In LostInSpaaaace I generally used a Clickable sprite and the Object clicked event to trigger the walk (see here https://www.youtube.com/watch?v=-rtnk9OGCQY).
eg:
When object clicked:
- Used Walk To command to start chracter walking towards target placed near where clicked object was in scene
- Used Face Direction command to ensure character was facing the correct way
- Used Say command blocks to describe the clicked on object etc.
can you have a script that lets you look in 3D?