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 /
avatar image
0
Question by Newbee · Feb 20, 2012 at 12:27 PM · collisionlight

Custom Collision

i hv imported a Table Lamp in .fbx format.... i wish to hv such that when i click on d switch in d model...the light should switch on/off... i hv written d script.... bt ths script is applied all over the Table lamp model... hw do i run ths script..onli whn d user clicks on a "part" of the model(ie The switch) plzzz help...:-)

Comment
Add comment · Show 2
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 FLASHDENMARK · Feb 20, 2012 at 12:29 PM 2
Share

You seem to be missing some buttons on that keyboard.

avatar image syclamoth · Feb 26, 2012 at 03:39 AM 0
Share

Yeah, there's no 160 character limit here! Bad spelling and omitted grammar are just laziness.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by adrenak · Feb 20, 2012 at 06:43 PM

I agree with OrangeLightning there lol! Anyways here's how i would have approached your problem:

  1. have a script with a raycast from the camera in the forward direction.

  2. Detect when the user presses the button assigned for switching on the light. When this happens, check whether the ray was hitting the switch or not.

  3. if the ray did hit the switch, then access the light and invoke a function in a script that is attached to the light. This function checks if the light is on, if it is on then it switches it off and vice versa.

There is plenty of information on this Webste and also the manual to help you with the coding. Try doing it yourself if you have got a basic idea.

I Hope this helps!

Comment
Add comment · Show 1 · 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 Newbee · Feb 26, 2012 at 03:29 AM 0
Share

Oh,I am sorry for using the sms lingo here OrangeLightning.(Innovative name) Yes,I get it VatsalAtTrifekt.Thank you so much!!

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

8 People are following this question.

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

Related Questions

Collision with light 1 Answer

Light on contact 1 Answer

,How to add value to a Light range that is counting down. 0 Answers

Light Colision 1 Answer

Light rarely turns on 1 Answer


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