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
- how to save when there is only one realm object
- c # - i want to move an object to the center of the screen in unityvr vr space
- c # - want to avoid floating while moving in unity (moving with rigidbodyaddforce)
- 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 make the current angle of the object in unity the angle of the entered value (in world coordinates)
- c # - i want to display the information of the object at the mouse position in another place in unity
- [c #] in unity, i want to repeatedly move the cube object to the z axis, but a variable conversion error occurs
- 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 # - prevent prefab from disappearing after scene transition
- unity c # i want to make a jump only while touching down
- c # - the generated prefab is not displayed
- c # - i want to control the transition of animation with a script
- c # - point the camera with the plane rotated 90 degrees in unity
- c # - only the camera component is enabled and cannot be switched on/off
- c # - i want to change the viewpoint of the camera when i press the "1" key
- c # - i want to get an integer array of random numbers instantly when the game starts
- c # - i want to get the coordinates of thisgameobject and install a prefab at a certain distance
- c # - i want to connect outlets to a specific prefab without converting objects in the scene to prefabs