Nice to meet you.
Currently using the SkyCar model in Unity's StandarddAsset
If there is an object (for example, a car other than the player) ahead, I would like to make it so that it stops before the player hits the vehicle, but I'm worried about it.
I imagine the image is like an eyesight, but is there any good way to do it?
Answer # 1
Just like Eyesight, it is a function that checks for an object that hits an invisible ray.
Physics.Raycast-Unity Script Reference
Please also see here.
Tips for asking questions ｜ StackOverflow
- c # - unity: i want to move an object according to the moving platform
- c # - i want to make the current angle of the object in unity the angle of the entered value (in world coordinates)
- c # - object references not set in the unity instance
- unable to attach c # script to object
- c # - unity) object up and down
- are there public variables like vb in c #?
- c # how to rotate an array of object type with foreacf
- c # - about setting clone object variables
- c # - determine if there are any objects in the unity area
- c # - ray's hitpoint with a specific object
- c # - is there a way to change unityenginecolor  to flort ?
- c # - i don't understand object orientation
- c # - i want to move an object to the center of the screen in unityvr vr space
- [c #] in unity, i want to repeatedly move the cube object to the z axis, but a variable conversion error occurs
- c # - [unity ray cast] execute the function of the object that received the ray
- c # - i want to reflect object data in view
- c # - pun2 suddenly destroy object
- c # - i want to process when there is no tag in xelement
- c # - [unity] i want to store the transformpositiony of the dynamically generated object in a list or array and get the maximum
- c # - i want to send an object from view to controller
- c # - point the camera with the plane rotated 90 degrees in unity
- c # - unity) show/hide prefab button conditionally
- c # - is the corner of the scaffolding object a 3d model jumped in unity? if you touch, you will fly to an abnormal height
- c # - i want to create an npc that tracks multiple players by switching targets
- c # - i want to execute fixedupdate after waiting 10 seconds at void start
- c # - i want to rotate the gyro sensor of the smartphone and the object of the smartphone on the scene in sync with unity
- c # - i want to create a player respawn process using "setactive"
- c # - unity about camera control i want to zoom with mouse scroll
- c # - unity) i want to use removevalue
- c # - i want to connect outlets to a specific prefab without converting objects in the scene to prefabs