iTween.stab error

Hi

I have a script where I use iTween to have an instantiated object follow a path, I try to use iTween.Stab to play the sound from an ambulance.

The ambulance runs fine along the path, and there is a speaker attached to it in the scene view. However the sound does not play. When I check the the clone of the object the in the Inspector, the attached Audio Scource does not contain the audio clip.

Any ideas??

Bob

The Code:

var instance: GameObject = Instantiate(ambulance, Vector3(758,2,924), transform.rotation);

iTween.Stab(instance, {“clip”: sirene, “volume”: 3, “pitch”:1});

iTween.MoveTo(instance, {“path” : [Vector3(738,0,932), Vector3(674,0,961), Vector3(672,0,995), transform.position], “time” : 6, “orienttopath” : true});

The error message:

NullReferenceException
iTween.GenerateStabTargets () (at Assets/Standard Assets/iTween.cs:3436)
iTween.GenerateTargets () (at Assets/Standard Assets/iTween.cs:3232)
iTween.TweenStart () (at Assets/Standard Assets/iTween.cs:4570)
iTween+c__Iterator2.MoveNext () (at Assets/Standard Assets/iTween.cs:6455)

Can you get me the project so I can take a look?

Yes I can do that on Thursday, then I´m back in the office.

How do I attach a file here?

Bob

info@pixelplacement.com

Problem sorted out…

The syntax in the hash table was wrong, it looks like that in some situations you can use “clip” and in others you have to use “audioclip”. as reference to the AudioClip to be played.

I have changed
iTween.Stab(instance, {“clip”: sirene, “volume”: 3, “pitch”:1});

to

iTween.Stab(instance, {“audioclip”: sirene, “volume”: 3, “pitch”:1});

Glad you figured it out - sorry I’ve been swamped.