- Home /
Dynamically changing a decals position on a mesh surface
I am experimenting with the builtin decal shader which I have applied to a vehicle model. I would like a user to be able to control the position of the decal at runtime using arrow keys for example. So after a user selects a decal texture that they like, they can then smoothly move it along the surface of the vehicle and choose whether it is positioned on the bonnet, the quarter panel, roof and so on. I have tried adjusting the uv position in the material settings but whether the texture is set to repeat or clamp, this either makes the decal get repeated on the opposite side of the vehicle or simply stretches the decal. Here is a game example of what I need:
Answer by Hamesh81 · Feb 14, 2014 at 01:48 PM
Rather than writing a shader for this I think you'd be better off projecting decals onto the car, that way they'll nicely follow the car's surface no matter where you move them to. The parts of the car you don't want to have decals (eg. windows) you can set to a different layer. For moving the decals around, you could write a simple "look rotation" script that always faces the projector towards the surface of the normal so it's not distorted while it's being moved.
Your answer
Follow this Question
Related Questions
Change scripted gui text postion 0 Answers
changing pivot's placement 2 Answers
Moving a GUITexture? 2 Answers
Camera not moving on mobile 0 Answers
Vector3.Slerp not working 2 Answers