So I’ve made a projectile with a ray, Simple question, How do I make a decal, (a texture that instantiates where the ray hits) in my game?
There are a plenty topics on this you just have to search for them. In The bootcamp demo there is a few nice scripts dealing with decals. The FPScam system is only 10 dollars right now at the asset store, and it comes with decals and a whole lot more.
Your Demo Link to your game is down/Broken.
thanks a lot for the heads up on the demo, did not notice that, it was working a week ago. Dropbox doesn’t keep it up for more then a certain amount of time apparently…
Just wondering, how do I rotate a ray so the decal doesn’t always instatiate within a few feet. Here is my current code:
You will need something like this (eg) Quaternion.FromToRotation(Vector3.up, contact.normal);
The contact would act as the hit(ray hit). So where your ray hits, you would instantiate the bullet prefab, then rotate it to the normal.
DropBox has never failed for me. So far lol
You may want to have a look at the Decal System. It does not only create a plane for the bullet, uses the target geometry for the placement.
Well I figured it out, sort off. Just instantiate a cube with a texture on it where the ray hits. Thanks anyways,