- Home /
Unity Editor Animating object reference.
Hi,
Unity can animate sprite object reference in the sprite renderer component. Also, it supports drag and drop in the timeline. Is there any possible way how to implement the same behaviour for other scriptable objects ? Even via reflection? Thanks.
Answer by keely · Aug 03, 2015 at 10:45 AM
For now it supports object references to unity built-in assets (Mesh, Material, Sprite, etc.)
Your own assets derived from ScriptableObject do not work.
I noticed that :) Would there be any possibility to use custom scriptable object in the future? Right now I created an workaround with an array an float which is behaving like an index. But my customers feels that this is more an hack than a proper solution.
Since the answer is from 2015 I'd like to know if this is still the case? I also wanted to embed an object refence in an anim file, but it didn't work:
var Reference = $$anonymous$$yAsset; // an asset I loaded from somewhere... (PostProcessing Profile, Playable, ...)
var Binding = EditorCurveBinding.PPtrCurve("", Reference.GetType(), Name);
var $$anonymous$$eyframes = new[] { new ObjectReference$$anonymous$$eyframe { time = 0.0f, value = Reference } };
AnimationUtility.SetObjectReferenceCurve(Clip, Binding, $$anonymous$$eyframes);
Your answer
Follow this Question
Related Questions
Parenting a sprite pixel perfect to an animated sprite 0 Answers
Scriptable Objects, how to force Include in Compile / Build without referencing it in the scene? 1 Answer
Efficient sprite sheet animation with Editor preview 0 Answers
Run sprite animation in editor mode? 0 Answers
Animator dialog doesn't pop up when sprites are dragged 0 Answers