Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
avatar image
0
Question by vivalarosa · Jul 11, 2011 at 10:59 AM · ioscontroller

Script working for standard FPS controller not mobile FPS controller

 function OnControllerColliderHit (hit : ControllerColliderHit) {
     if(hit.collider.gameObject == GameObject.Find("Cube")){
         Application.LoadLevel(1);

This is a simple script i attached to my First Person Controller prefab, when i attached the same script to the First Person Controller prefab from the mobile standard assets it ceases to work.

Is there any reason for this? If im scripting wrong for Ios can someone direct me to a source that can help me please?

Thanks in advance :)

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 Jan Helleman · Jul 11, 2011 at 10:40 PM

Is it crashing? I had this problem once, turned out my next level had unsupported game objects (for example, cloth physics) in it. Even if it's "disabled", it fails on Application.LoadLevel, even though it does work when you set that level as the first active level.

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 vivalarosa · Jul 12, 2011 at 02:12 AM 0
Share

Hey Jan,

it's not crashing, it simply doesn't work. I'll hit the collider but nothing happens. The 2nd level is a duplicate of the first, just with a few things moved so that i can recognise the change.

I place the script on the parent on both fps controllers, just the mobile standard assets one just doesn't work.

Thanks for the help :)

avatar image Jan Helleman · Jul 12, 2011 at 09:24 PM 0
Share

have you tested print("") ins$$anonymous$$d of loadLevel to test if it even gets to that point? Are you sure there is an object called "Cube"? Have you tried if loadLevel() works within another function? What were your debugging steps?

avatar image vivalarosa · Jul 13, 2011 at 12:36 AM 0
Share

Figured it out thanks :),

The problem was on the normal fps controls i added my collisions script to the parent (which worked fine), but for the mobile assets you have to attach it to the 1st child as the other control scrips are there.

Thanks for the help, it's really appreciated :)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Can you detect the movement of the left and right How can it? 1 Answer

Hover Car Controller? 0 Answers

Turning GUI off not working for iOS 1 Answer

Sprite Sheet Issue 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