Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom gizmo doesn't trigger update of PlayableAssets (like AICommandClip) #6

Open
raphipaffi opened this issue Mar 5, 2021 · 0 comments

Comments

@raphipaffi
Copy link

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

@raphipaffi raphipaffi changed the title Custom gizmo for PlayableAssets (like AICommandClip) don't trigger update of playable Custom gizmo doesn't trigger update of PlayableAssets (like AICommandClip) Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant