Consider this scenario, you have a bunch of coloured blocks piled on top of each other like a blocky 3d mountain.
I am fiddling around with some code and basically I want to change the character’s skin colour according to the colour of the block it’s touching. If it’s not touching any block I do not colour the skin.
I am trying to think of the best way of implementing this, I don’t think using touched would be sufficient, any ideas of what I can use to implement this please?
Hmm, only problem is that only accounts for standing onf the block but I can always raycast to all player’s sides to account for the rest.
However, there’s still a problem if you have a bunch of blocks next to each other and a player is touching more than one block, you’d have to determine which you’re going to prioritise probably through checking the which block is the closest?
.Touched would be sufficient, and much easier than using a raycast system to do so. If you don’t know how to use raycasts, you should just use a .Touched event for all the parts in your character, and whenever a part hits the part in your character, change the colour.
Using .Touched events for every part in your character, instead of every coloured block you have would be better for performance.