- Home /
Question by
bryanbob · Jan 29, 2014 at 05:59 AM ·
movietexture
seeking video by using audioSource.time not working
Hello everyone. Im a beginner in unity scripting. i need help with my script. i want to seek a movietexture by using audiosource. but it is not working as expected. below are the script
using UnityEngine;
using System.Collections;
public class PlayAt : MonoBehaviour {
AudioSource audiosrc;
MovieTexture VideoClip;
void Start () {
audiosrc = this.renderer.audio;
VideoClip = (MovieTexture)this.renderer.material.mainTexture;
if(VideoClip.isReadyToPlay)
{
//audiosrc = new AudioSource();
audiosrc.clip = VideoClip.audioClip;
audiosrc.time = 20f;
VideoClip.Play();
audiosrc.Play();
}
}
void Update () {
}
}
thank you for any help..
Comment
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Video Scrubber Bar & Rewind using MovieTexture? 0 Answers
How to make a seamless transition between movie clips? 2 Answers
Movie texture ( I have pro ) 2 Answers
Restart Script help. 0 Answers