Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I am making a game where red bullets are coming down on the screen at you, and I have the instantiating part done, but I can't figure out how to make them spawn at a random spot along the top of the screen. I am using Unity.
What you could use is the built in unity function of Random.Range(minValue, maxValue) and than where you spawn the prefab you assign a variable using Random.Range as the x location. Example from Unity Offical API
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I wanted to setup a minimap for my multiplayer game. I am using photon for multiplayer.
Thanks in advance
This question is probably too vague, but the rough strokes of how I would do it would be as follows
Render you scene (or only your environment) from a top down orthographic camera
Write a shader that transforms your player's positions to this camera's screenspace and draws a marker at their position (this can be quite difficult)
Render this out to a texture and display it on a mesh at the top of your screen / UI
This is not something that is super easy to do, you might be better just looking for one on the asset store.
If you have any difficulties then maybe ask another question specifically focusing on the area you're struggling with
best of luck
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I created an island and want to check when I reach the island.
How can I add a tag to the island? The island built from a set height of the terrain.
I added a picture for better understanding:
You can bound your island using invisible cubes with colliders as triggers.
You can detect a terrain texture and check if a current texture equals an island's texture - detecting a terrain texture is at a following link: detecting terrain texture
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Well, I'm new to unity and I'm trying to make a risk-like game, but
I'm struggling in the first steps.
Want I want to do is make dots, that are going to be the conquistable locations, and jointing them with lines to show to the player wich locations are connected together. My problem is: How can I make this lines, that the player must see? How can I position this line using the locations position?
Thanks for the help.
you can use LineRenderer for the same.
Have to give positions list of Vector3 & can create the line.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
When I shoot a projectile while running the projectile collides with the player, i.e. the player's collider is hitting the bullet's collider.
What is the best way to prevent this? By making a space between the gun and the projectile to avoid collision?
There are 2 ways I can think of right now.
1- You can create a selective collision script (or edit your existing one) and add an exception for the player object. So, bullets can go through the player. This is the main way to go.
2- You can use layers (or Z depth) and you can create a whole layer for bullet spawner etc. And make enemies also have targets in that layer/depth.
I don't have Unity installed on my current system right now. But I will install it when I get a chance, and if you don't solve it until then I will try to help properly.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am making a car game. My cars are colliding, but I don't want the cars to collide - I want the cars to go inside of the other cars, which have both a rigidbody and a collider. Is there a way to allow my cars' colliders to ignore each other for physics interactions?
Go to project settings, physics and take a look on the matrix.
With this matrix you can exclude cars colliding with each other giving them proper layer and unchecking this layer to colide with itself.