Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do I play a MovieTexture with raycasts

Discussion in 'Editor & General Support' started by BearSheriff, May 18, 2015.

  1. BearSheriff

    BearSheriff

    Joined:
    May 14, 2015
    Posts:
    20
    Hey guys I want to be able to play a movie texture with raycasts. The idea is to make this movietexture play after looking at it for a few seconds. I am kind of new to this and am having trouble messing with the Raycasts
     
  2. mholub

    mholub

    Joined:
    Oct 3, 2012
    Posts:
    123
    https://www.dropbox.com/s/ahpf12okqcycw9l/RaycastExample.unitypackage?dl=0 — I put small example project for you. Try to understand how it works and adapt for yourself.

    Look at LookAtRaycaster.cs.

    It fires UnityEvent when it sees something which belongs to "Interactable" layer for Duration specified. It can be handled appropriately. For example in the example I make one object change color and other change scale.
     
    BearSheriff likes this.