How to get the color under the player's current location?,How to get the color under the location where the player is standing?
[2D, sprite-based game in Unity 3D]
For instance, let's say I have some areas of a map that are "toxic" and deal damage to the player if they're standing over it. These areas would be marked in red.
I would want a script that checks the pixel on the player's location on a map and give a color output. Then, I could check if the color's hex values match (#ff0000) or something and run code based on that.
I believe Texture2D.GetPixel can do this, but I don't know how to use it. Any pointers that may help me? Thank you.
Your answer
Follow this Question
Related Questions
Filling 3D sphere with color. 0 Answers
Capture Mouse position color of pixel from current frame of Movie Texture 0 Answers
[Problem] Change 3DText color with C# script 1 Answer
What is color and what is material (in the context of gameobject)? 1 Answer
How to do Image Swap with Text Color the with New UI Button Transition? 0 Answers