This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello, so I not sure how to fix this, and after 1 hour of googling and testing different things, I rather jsut ask you guys.
So, I have a parent-object, with the children: a car (3d mesh) and some other child-objects.
Now I am trying to cast a RayCast starting infront of the object, but I've tried:
thisUnitVector Vector3.forward
But the RayCast starts in the middle of the car-object, therefor the first collider it hits, is itself. Therefor I can't detect if the RayCast hits anything else. (I can't use different layers, as there are several car-models in the game at the same time.. its a RTS)
I just can't get it to start infront of the car...
Sure, I can just add thisUnitVector.z = 2.0f; But that is just not a good solution.
Ultimately I want the RayCast to start at the front (edge) of the boxcollider! Because I don't want the object to detect itself.
Thanks, Simon
Use a layer mask to have the raycast not detect the layer that the car is on.
Subreddit
Post Details
- Posted
- 9 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Unity3D/com...