Hi,
I have a white ball. When I press right mouse button blue spot should appear on the ball(aimspot). It should be possible to move this spot.
What is the simplest solution in Unity? Additional texture with uv shifting?
Hi,
I have a white ball. When I press right mouse button blue spot should appear on the ball(aimspot). It should be possible to move this spot.
What is the simplest solution in Unity? Additional texture with uv shifting?
A simple solution might be to attach a Projector to the tip of the cue stick, that projects a texture with a blue circle in it. The projector will take care of texturemapping the circle texture onto whatever geometry it hits. This is really easy to set up, but has a few added side-effects that you’ll want to take care of:
There is also a way that doesn’t involve a Projector. You can do a Physics.Raycast from the cue stick’s tip and forward. It returns a RaycastHit-object, that gives you a lot of useful information about the geometry it hit (the cue ball). See:
http://unity3d.com/support/documentation/ScriptReference/RaycastHit.html
Perhaps you can use the UV coordinates or the point the ray hit to position the aim spot texture.