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 artsdcs · Dec 13, 2011 at 10:07 PM · glowmagic

magic glow?

im realy new to unity and im busy with creating a FPS. i have an idea inspired by amnesia. what i want is to be able to pick up objects like in amnesia and move them around. only differenc is that i have a hand in the corner that i want to glow a colored light when i hold something and stop when i release my mouse button(also the object will fall down again) i tried to use a flashlight but that didn't give the effect i wanted.. so can anybody help me write a script for it.

also i work with cinema 4d and i think about making 2 textures one normal and one that glows and if i press my mouse button it switches to the one that glows and if i release it it turns back to normal.

i hope that was enough info.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by bradmarxmoosepi · Dec 15, 2011 at 05:25 AM

If you are looking for a magical light effect, why not try using particle effects?

For instance, you could have a prefab that is a light and a particle emitter, and instantiate one when you pick up an object.

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 artsdcs · Dec 15, 2011 at 11:21 AM 0
Share

so like you would do llike a flashlight. i get it that's a pretty good idea i will try it!

avatar image
0

Answer by artsdcs · Dec 15, 2011 at 12:49 PM

oke i tried it and i stumbled upon this script

function Update() {

if (Input.GetKeyDown("f")) {

 if (light.enabled == true)
 
     light.enabled = false;
     else
 
     light.enabled = true;
 
 }

}

but how do i make it so it begins when i press my mouse button and stops when releasing it and how can i make that script so that i can do the same with particle effects?

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 ConsoleHack000 · Jun 07, 2016 at 08:58 AM 0
Share

a quicker way: if(Input.Get$$anonymous$$eyDown("f")) light.enabled = !light.enabled don't miss the ! mark

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

magical glowing blue globe 3 Answers

Player Controller Rotation Script Help 2 Answers

Enemy killing help 1 Answer

Spawn Script Not Working 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