Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
2
Question by Firetrain · Jul 06, 2018 at 02:38 PM · 2d2d game2d-platformer2d-physics2d sprites

Help Me! I want to make a pixel fairy!

Hello! I am making a 2d platformer like game. The game starts in a dark cave with overworld light decreased. The player is with a 1 pixel size fairy. THE PROBLEM- 1. I want that fairy to glow and produce light moving in all directions. But I don't know how to give light like effects to game objects. 2. I want an AI script for the fairy so that she will always hover near me like an ally. 3. The cave is divided into two because of a wall. I want one side of the cave dark and the other a little bright because of a cave entrance. Can this be done? Will a directional light collide to the wall? Will the wall prevent the lighting to reach the other side of the cave? If no, is there another way? Pls HELP!!!

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
0
Best Answer

Answer by TheKnightsofUnity · Jul 06, 2018 at 04:50 PM

Hey @Firetrain !

  1. Right click on your fairy GameObject -> Light -> Point Light. That should create a new child object with Light component. For a glow effect I'd advise looking for an asset on the Unity Asset Store.

  2. A simple way to achieve this would be to add a new child to your player object that would contain only a Transform component and place it somewhere besides your character. Then add a new script for controlling your fairy and attach it to the Fairy game object. Edit the script and write something along these lines:

public class FairyController : MonoBehaviour { [SerializeField] private Transform targetSpot; [SerializeField] private float moveSpeed; private void Update() { transform.position = Vector3.Lerp(transform.position, targetSpot.position, Time.deltaTime * moveSpeed); } }

Now you can drag'n'drop the player's child object to targetSpot field and experiment with moveSpeed value until you're content with how it works.

3.If you use point lights and the wall object and its material are properly set it should work as you want it to work. Try it out in editor and go back here if you have some problems with it.


Hope that helped :)

Cheers!

Comment
Add comment · Show 2 · 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 TheKnightsofUnity · Jul 06, 2018 at 05:04 PM 0
Share

Can't get the code markdown to work so here's a link to the same code with clearer formatting: https://paste.ofcode.org/Zp5W26E6TeGuwe7FXzBQia

avatar image Firetrain · Jul 07, 2018 at 01:07 AM 0
Share

Thanks! I will try it out and tell you if any problem arises. So please keep looking into the question. I will tell you if all of it worked. THAN$$anonymous$$S AGAIN!!

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

187 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I stop my sprite from jumping in the air? 1 Answer

Making the enemy follow the path of the Player,How to make the enemy follow the path of the player? 0 Answers

How to check if an object hits the ground hard enough then add explosive force around it (2D) 1 Answer

Instantiate a GameObject with a specific Z rotation 2 Answers

Exchange player position to only 3 possible places with a platform 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