All Questions
Tagged with c# unity-game-engine
43,314
questions
0
votes
1
answer
26
views
How do I make a different interval for the appearance of balls?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnManagerX : MonoBehaviour
{
public GameObject[] ballPrefabs;
private float spawnLimitXLeft = -...
1
vote
1
answer
41
views
Why do my terrains sampled from heightmap image files look "blocky"?
I generate terrains from heightmaps but results look "blocky".
It works if I sample the PerlinNoise method for the grayscale value but not when I read it from a texture. Debugging shows a ...
1
vote
0
answers
37
views
How to access the mesh of static variable in unity c#?
I have a problem the problem is this how can I access the mesh of the static variable in unity when the variable is in another script and I want to change the mesh in other script if i do not make it ...
-1
votes
1
answer
39
views
I need help switching sprites when I press A and D
I am trying to make a script where the sprite changes depending on what button you press, right now I am only doing A and D, left and right. I cant get anything to work, I have tried everything I can,
...
0
votes
1
answer
26
views
Making the player move to the right or to the left when the arrow is clicked in Unity
I was working on a script where, if you click the right arrow, the player moves at a constant speed towards the right side of the screen, then stops after leaving the screen. (Similarly, if you click ...
0
votes
0
answers
28
views
Draw renderer-line only on roads
I was wondering if it's possible to make my line renderer to be drawn only on the road asset. The problem I'm having is that I bought this asset and the road is combined with street.
Is there any way ...
0
votes
0
answers
36
views
Improving A* path finding efficiency in a 2D Grid based Unity game
public List<Node> FindPath(Vector2Int start, Vector2Int target)
{
List<Node> openSet = new List<Node>();
HashSet<Node> closedSet = new HashSet<Node>();
Node ...
0
votes
0
answers
32
views
Unity Netcode How to reparent an object
I am making a multiplayer game using Unity Netcode. When my player object approaches a planet object, I want to parent the player object to the planet so it moves with it. How should I do this please?
...
1
vote
1
answer
80
views
Run expensive operation in the background without awaiting a result
I have done my research on the topic, but I still do not fully understand the async and await blocks in C# as a lot of people suggest different functions and approaches. Still, I can't find anything ...
0
votes
1
answer
63
views
Stopping Enemy Rotation before Looking Directly at Player
So the problem is, I'm working with 2D sprites in a 3D environment and when the sprite is directly vertical to the camera, you can't see it. Now, I managed to get the player working by tracking ...
-1
votes
0
answers
52
views
Infinite loading occurs while opening Unity project
I am a Unity beginner. I decided to collaborate with my friends, so I downloaded the project(2022.3.4f1) from the UVCS repository and tried to open it. However, a window named ��Downloading project ...
-1
votes
0
answers
26
views
Unity 2D animation lagging and skipping frames
I am making a game in unity 2d, and i was starting to implement some animation when I ran into this problem. For some reason, my character's animation started to skip frames(about 12 i think) and I ...
0
votes
2
answers
44
views
My player movement script randomly sends the player in seemingly random directions sometimes
I am new to Unity and the following code is supposed to be a player movement script. Everything works as expected until every now and then, usually when multiple inputs are pressed in succesion, the ...
0
votes
0
answers
21
views
Exception when initializing CastingDevicePicker in Unity for UWP (Hololens 2)
I'm currently working on a Unity project that targets UWP, and I need to implement a feature to connect via Miracast. I'm trying to use the CastingDevicePicker from the Windows Runtime API, but I'm ...
0
votes
2
answers
74
views
How can I fix my movement code? The player won't move correctly
I am new to coding and c#, but I have been trying to make my player without gravity affecting it. But my player keeps moving up and doing nothing else. I have started by trying to make it move to the ...