-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Hey Ciro,
first of all, thanks a lot for the great examples in this repo. They are spot on for what I am building and the code is really easy to follow. Great work!
I am working on custom timeline playables and stumbled over one issue that I couldn't resolve. I coded a playable that is very similar to your example with the AICommands to move characters in the scene providing a target position and relying on Navmesh in play mode. For preview in edit mode, I use a custom editor that shows a gizmo to manipulate a target position, just like your example code:
https://github.com/UnityTechnologies/ATerribleKingdom/blob/master/Assets/Scripts/CustomTimelineTracks/AICommand/Editor/AICommandInspector.cs
Now, if I manipulate the target coordinates in the inspector (not using the gizmo) the clip object automatically updates and I see how the character changes position in the scene view. However, if I use the gizmo in the scene view to change the target, the playable does not update automatically. I see the coordinates change in the inspector but the character in the scene view does not follow. In other words, CreatePlayable in AICommandClip is not called if I use the gizmo with OnSceneGUI. It is only called through OnInspectorGUI()
As I am new to timeline and its graph architecture, I don't really understand how to trigger the graph from OnSceneGUI to reinvoke CreatePlayable. Hope my explanations are not too confusing. Any help is highly appreciated.
Best,
Raphi