Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post is currently awaiting moderation. If you believe this to be in error, contact a system administrator.
avatar image
0
Question by psych881 · Sep 14, 2013 at 09:32 AM · c#androiderrorbuildcompiler

Compiler errors while switching to android

I had it set to web player and had no compiller errors now that i switch to android i come up with this

Assets/Scripts/VideoController.cs(9,17): error CS0246: The type or namespace name `MovieTexture' could not be found. Are you missing a using directive or an assembly reference?

my code for VideoController.cs is

 using UnityEngine;
 using System.Collections;
 
 public class VideoController : MonoBehaviour {
 
     // Use this for initialization
     void Start () {
         
         MovieTexture movie = renderer.material.mainTexture as MovieTexture;
         movie.Play();
     }
     
     // Update is called once per frame
     void Update () {
     
     }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by vexe · Sep 14, 2013 at 09:34 AM

This means that the compiler couldn't find the MovieTexture class anywhere within your project. Are you sure it's there?

EDIT: So you're a JS coming to C#, first watch some C# tutorials.

When you write your script in JS (say myScript.js), you'll get a blank script that looks like this:

 function Start()
 {
 
 }
 
 function Update()
 {
 
 }

You are actually writing inside a class, but you don't know it. The equivalent of this in C#:

 public class myScript : MonoBehaviour
 {
   // *
   void Start()
   {
 
   }
 
   void Update()
   {
 
   }
   // *
 }

What's between the '*' is what you get in JS. So, go to Unity, create a new C# script, name it MovieTexture - and write your code inside it.

Or if you wanna write the class in the same file, just get out of the scope of the current class and do

 class MovieTexture
 {
   // your stuff goes here...
 }

EDIT: I haven't used MovieTexture before so I thought it's a user-defined class.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image psych881 · Sep 14, 2013 at 09:38 AM 0
Share

This is the only script I have to play the movie. How do I create a $$anonymous$$ovieTexture class that will fix this error. I am more confortable with javascript than c# so I have no idea

avatar image RyanZimmerman87 · Sep 14, 2013 at 09:42 AM 2
Share

http://docs.unity3d.com/Documentation/$$anonymous$$anual/VideoFiles.html

You should read it, movie textures are not supported by Android/iOS at the bottom.

avatar image psych881 · Sep 14, 2013 at 09:59 AM 0
Share

uh oh Androids cant use it now im screwed because i have invisible buttons with the buttons for the user in the video

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Compiler error while switching to android 1 Answer

Gradle build faild. see... error "in unity 2020.1.4f1!!!" 0 Answers

Problem with Mono compiler 0 Answers

Character Movement Problem 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges