Thursday, July 7, 2022
HomeGame Developmentunity - Make ray bypass single sport object?

unity – Make ray bypass single sport object?


So I’ve a projectile and a chunk of armor. What i have to have occur is the projectile (a ray) fires, it hits the armor, checks to see if it may well penetrate the armor, and if it may well, spawn a second ray that’s both on the opposite facet of the armor or simply ignores that particular armor plate. I really feel like the primary choice can be simpler for the next purpose.

i dont suppose i can simply set the ray as much as ignore a layer. It’s because i’ve no means of understanding if that ray goes to hit one other piece of armor. Shall we say i’ve this.

armor — armor — damageable part

what ought to occur is a projectile fires, hits armor one, sees that it may well penetrate that armor, then the opposite ray spawns, and hits the second plate, checks to see if it may well penetrate it, and if it may well then it may well spawn one other ray which can then hit the part. I do not suppose I can use layers for this. For instance armor is on layer one, projectile fires, it hits the primary piece of armor, is ready to penetrate it, spawns a brand new ray that ignores layer one. Then it should ignore the second piece of armor and simply harm the part.

However I am unable to set each armors to have totally different layers both as a result of the armor of no matter is being shot at might not have 2 layers of armor, it might have 3 or 4, or none in any respect. not solely that, the armor might not deliberately be layered, the armor in query may each be exterior armor plates, however they overlap in sure elements. I cant actually set every plate to have its personal layer as a result of there may probably be 100 armor plates, that will be loads of layers to arrange. In order that’s why I believe one of the simplest ways ahead is simply to spawn one other ray on the opposite facet of the armor plate… however I do not understand how to try this. Both that or if there’s a strategy to make the ray ignore one particular object, then that might in all probability work.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments