I am currently working on my Tiberium addon and i want it to spread across the surface of the map, my old one uses traces in a random direction but this does not always work (Hits nothing most of the time) so i am asking if someone has an better idea on how to make entities spread.
I would say make on in the air in the direction you want it to go and then downwards?
Deco has a complex mapping system that creates a table of viable floor based positions that I’m sure he’ll suggest but if you’re going for basics just do as commander204 says and fire a random trace and if it hits nothing, fire another one straight down.
I also thought of that system, but i think it would look a bit strange when the entities appear in squares, I think i will use the simple “random trace, if fails shoot down” thing, but if there is a better way i’d still like to know about it.
Also make sure to check the math.acos(traceRes.HitNormal:Dot(Vector(0,0,0))) to find out how much the surface angle differs from a flat surface. You don’t want tiberium spawning on the wall do you?
Actually, it looks quite awesome when it does that.