Question regarding reading of colour
BriggzyJ97 opened this issue · 2 comments
Hey!
I love your ink painter asset and have converted it a little to work in our top down shooter, and it works fine but we need it so that players and enemies can read which colour is below them to activate certain effects on them i.e. speed boost etc. Was wondering if you had any advice or knowledge on how to do this?? I've tried GetPixel but doesn't seem to work because the mainTexture of the ground is changed to something that i don't know what it is. Looking through your scripts gave me the idea for GetVector but im not entirely sure how that would work.
Hi!
Painted textures can be obtained with GetPaintMainTexture.
However, it is RenderTexture, you need to convert it to Texture2D to use GetPixel.
This method is very heavy processing. Calling it repeatedly is not recommended.
Okay, awesome, that gave me an idea that should work on how to read the colours. Thanks for your help!
Don't know if you were interested but the development of our game is gonna be put on twitter here: https://twitter.com/PrimeFoolery