Unity light creates rare blue light on sky - c#

I'm doing a Unity project where I basically have a Directional Light rotating around the map, starting on 0 to 360 degrees.
However, when it gets dark = rotation from 100 to 120 degrees I get this strange blue light coming from the sky, does anybody have any idea on how to avoid this blue thing appearing?
Image to explain the problem

It seems to be a Lens Flare. Check if you have "Flare Layer" on your Main Camera and disable it.
https://docs.unity3d.com/Manual/class-FlareLayer.html
https://docs.unity3d.com/Manual/visual-effects-lens-flares.html

You can try as follows:
Find the little blue dot step by step and delete it. First click on the point light source in the scene, find Light->Flare, as shown below
Click 50mm Zoom to find it in the project view and see its detailed properties in the Inspector. As shown below.
Click on the elements, you can find that it has 19 elements, expand each element, and find that the color of one element is blue. As shown below:
That's it. Set the size to 0 and the problem is solved.
Thank you, hope it helps you

Related

Im trying to create a menu scene but when i render it, it is kinda dark. How to fix the dark lightning

As you can see in my Unity scene
it looks dark.
game tab
you can see here that it's dark.
I've done going to window > render > lightning > clear baked data but its still the same.
Any unity devs can help me, thanks
As you can see in my lightning tab
auto generate is disabled so I can't check it to verify if it can solve my problem.
Somewhere in the Canvas you have an object that has a sprite on it where the color is modified. Also check the alpha setting for the colors there.
Lighting doesn't affect UI elements like that. That only applies to non UIElements like 3D and 2D objects placed in the world (https://docs.unity3d.com/Manual/LightingInUnity.html).
So it's just a sprite that is causing this background color as #Çağatay IŞIK suggested.

Unity - healthbar as outlined line around the screen

I have a game in Unity.
The idea of the game is that an object is spawned on the screen.
It exists for several seconds.
You need to click on it, while it exists.
What I want to do, is that while it exists - I want to show a timer, but not with numbers, but with an outlined line on the perimeter of the screen.
I know, how to make a make a slider and how to make circular health bar, yet I do not really have an idea to make a slider, that is decresing from everywhere to the centre as you can see on the screenshots below.
I would be thankful for the inspiration!
This should be a very good fit using alpha cutoff with a custom shader.
Here's a video explaining it in detail (it's only the first half you will need).
The basic idea is to create a texture with a graded alpha depending on how you want the texture to appear/disappear. In this case the alpha value at the top and the bottom would be close to 0 and then gradually around the line on both sides towards the middle increase to 1. The shader then cuts off the texture below a cutoff threshold which you can change depending on the value of the timer.
As a dumb and simple approach:
Have two images with fill, one goes middle towards top the other middle towards bottom.
Just imagine the pnguin is your outline ^^

Unity3D two box colliders(2D) common border problem

As the image shows, two box colliders(2D) stay close together, while a circle collider(2D) fall on the common border.
I hope it will bounce forward (blue arrow), but sometimes it bounce back (green arrow).
I have checked the position and the width, and have make sure the box colliders(2D) are touch to each other perfectly.
(positions: (0,0), (2,0), widths: 2, 2)
I am new on Unity, and have no idea how to prevent the strange bounce.
Please give me some help, thanks.
Image
Maybe It'll work if you edit the colliders like this:
I am not quite sure what is the problem, I hope this helps.

Detecting an objects position and direction inside an image

I am trying to gather a position and a direction of an object inside an image.
The image can look like this for example:
http://i.stack.imgur.com/4ehUy.jpg
The object is shown as a blue circle.
What I've tried so far is using a basic pixel search, but it seems like the circles blue isnt always the same (maybe because of the shapes and the enviroment) and when I give it a color range (e.g. red 130 - 150, green 110 - 120 and blue 90 - 100), it isnt reliable, because sometimes the pixel is recogniced on top of the hole, sometimes on the right site and so on. Further more the next step would be getting the direction of the object, which is even more difficult, because of the enviroment, which can be very similar to the light infront of the object.
Again, what I'd like to know is the current center of the circle and the angle it is aiming atm...
Is there a library or a way to do this? I am using C# / WPF to program my application.
I found a solution on my own:
All you need is the AForge library. With the AForge library you can do some experiments with color filtering (I used a blue) and after some calculations you will get the center position of the player. :)

How to scroll progressively a game object?

I am developing a game with Unity which has a main menu to allow the user select game mode. In this screenshot you can see an example:
My problem is the following:
I need to create a scroll in which user can put his finger on point 1 and swipe/slide to point 2. On the one hand, while this action is happening the element 2 increase its opacity and its position change progressively to the center. On the other hand, while this action is happening the element 1 decrease its opacity and its position change progressively to the left part of the screen.
Extra information:
The elements are sprites with colliders to detect the selection of the player.
What would you suggest me to do? Have you got any code to solve this? Any other suggestion?
Hey i think i understood your problem,
According to my understanding. You can use a binary tree for this work, u can use a sprite sheet with different level of alpha value. The variable of the binary tree responsible for changing the sprite will depend on the finger's position on the screen which you can easily get by camera.ScreenToWorldPoint(pos). also you can easily change the position of the gameObject by recording the change in initial and final position of the touchPhase.

Categories