I want an object to change it’s height by the passed in value from the field in The SignalReceiver Reaction like this…
public void SetRigHeight (float yPosition) {
wantedRigPos = new Vector3(rig.position.x, rigPosition.y + yPosition, rig.position.z);
useSetRigHeight = true;
}
It works fine on the first Signal installed on the Timeline and passes in the value from the UnityEvent Reaction. However if you add a second Signal and try to set the value it will revert all previous Signal to the newest passed in value. I do not think it is supposed to work like that. You should be able to pass in any value and not have it affect any other Signals. On 2019.4.9f1 and using the Timeline 1.5.2 package.
It isn’t my code. It is your implementation of Signals. In the UnityEvent invoked from the SignalEmitter on the timeline track if you have a field to pass in a value, this value gets reliably passed into the function. However, if I place a second signal on the timeline and change the value, the new value changes the old value on the first signal. If I place a third signal and change that value it changes the value on the first two signals
In a SignalReceiver, a UnityEvent is associated with a SignalAsset. When you create a SignalEmitter on a timeline, the Inspector shows you the UnityEvent associated with the signal asset. If you re-use the same signal asset with multiple emitters, changing the event will change it for all emitters using this asset.
Create multiple signal assets: Use multiple signals assets and, in the receiver, set up the unity event to call the method with the correct arguments.
Example:
SignalAsset: “SetRigHeight2” → UnityEvent: calls SetRigHeight with yPosition=2
SignalAsset: “SetRigHeight3” → UnityEvent: calls SetRigHeight with yPosition=3
Put a payload in the emitter: It is possible to put values in the emitter itself, much like Animation events. But the signals system doesn’t support that and you will need custom code. Fortunately, there is an implementation here.
Similar issue also happens to me. Once I created a signal in signal track, somehow it reverts back to previous values. I can’t reproduce it always so there is no bug report. It looks like UI issue.
Also maybe related, playable asset in unity is not cleaned up once a script is modified or removed. I do have custom code to pass parameters, (The implementation mentioned above doesn’t work due to exception in Editor Inspector, so I have another one). And I noticed that remove the track or remove the signal won’t actually remove the monobehaviour section in playable asset (serialized as text, just open text editor to edit it). Also, sometimes somehow somewhat the signals disappears.