Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [c#]

C# is a multi-paradigm, managed, strongly typed, garbage-collected, programming language created by Microsoft in conjunction with the .NET platform.

Filter by
Sorted by
Tagged with
3 votes
1 answer
119 views

I'm trying to implement a robust pause system in Unity and I'm confused about the correct approach. My first (very simple) implementation in my previous project used a ...
Curio's user avatar
  • 231
0 votes
3 answers
132 views

Object pools are great. They are fun to make, save you a lot of memory and fps. But as my projects grow in size and complexity it gets harder and harder to work with them. If you only have a couple of ...
MrV's user avatar
  • 49
0 votes
2 answers
79 views

I'm making a 2D game using Unity and I want to implement cutscenes that change over at certain lines. ...
August's user avatar
  • 1
0 votes
0 answers
41 views

(Maybe good to know, this game is part of a game dev course where we had to make a Vampire Survivors like game) I thought SceneManager.LoadScene() reloaded EVERYTHING in a scene, like a clean state, ...
MrV's user avatar
  • 49
0 votes
1 answer
36 views

My player is baked entity in subscene while main camera is outside on scene. For some reason system cannot find transform of camera, GameObject was found though. <...
UNREAL's user avatar
  • 1
0 votes
0 answers
61 views

I have my OpenStreetMap data exported using QGIS as a gltf file, and I'm trying to align it with Cesium 3d tiles for my high resolution model. The problem is that both have different coordinate ...
cluck ham's user avatar
1 vote
1 answer
71 views

I am trying to make a digital clock (24:00 type), where each number is an individual image, that should change. So, I want to change sprites for multiple images in one piece of code. But when I ...
Ratty's user avatar
  • 13
0 votes
0 answers
118 views

Relevant to this issue are two MonoBehaviour scripts: Actor and Player. ...
Bunabyte's user avatar
  • 331
0 votes
0 answers
50 views

My unity project is 2D universal. My goal here is to create a comic-like panel with outlines behind objects that have certain tags. This panel should follow the rotation and size change of said ...
pockspocky's user avatar
0 votes
0 answers
61 views

I’m working on a liquid shader in Unity and could really use some help making it look more realistic. I’m going for that nice touch of transparency, reflections, maybe a hint of refraction—just ...
Dylan Ball's user avatar
0 votes
0 answers
62 views

I will use Addressables to load multiple assets of type Bag that share the same AssetLabelReference. So I will load them using ...
Ahmed Dyaa's user avatar
0 votes
1 answer
129 views

I'm creating a puzzle for my game, where you have to arrange pipes to transmit an electrical flow from one point to the other. Each pipe center contains a connector hub and each end contains the ...
Redsam121's user avatar
1 vote
2 answers
463 views

I've recently been attempting (and failing) to create my own character controller for my 3D Unity game for around a week. I hate the Unity rigidbody physics system for making a character controller, ...
Callumari's user avatar
0 votes
1 answer
103 views

I don't understand why my object does not follow the player. I instantiate the character with the PlayerPrefs I saved from another scene. However, the object tracking code does not follow, and also ...
Amadeus Von Alerta's user avatar
1 vote
1 answer
63 views

I'm currently working on my first game in Unity, and I'm having some trouble with attacking. Currently, I have a game object with a 2D capsule collider child. When the attack button is pressed, the ...
Tyler Harper's user avatar
1 vote
0 answers
116 views

So, in my breakout clone, I've encountered issues where the ball will sometimes phase through bricks and the borders if it collides with one and then immediately collides with another after. My guess ...
no good's user avatar
  • 11
0 votes
1 answer
120 views

I made character movement using AddForce. But I don't understand how to get the desired effect. I need that when I release a movement key (for example WASD) the ...
Friendlyap's user avatar
1 vote
1 answer
182 views

I'm working on a realistic VR bartending game for Quest, and I need some help with making bottles pour liquid into cups. I'm aiming for a system where: When a bottle is tilted, liquid pours out ...
Dylan Ball's user avatar
0 votes
0 answers
31 views

I tried to code an image to follow the character using canvas but it jerks when moving. Is this a bug? Do you have any solution to fix it? https://youtu.be/OnT9Pabgi2g ...
QChí Nguyễn's user avatar
1 vote
1 answer
126 views

I'm trying to determine the transformation steps (position, scale, rotation) needed to be applied to an object so that two points, locally positioned in that object, line up with two world space ...
Zeppelin's user avatar
0 votes
0 answers
68 views

Me and a friend created a basic multiplayer game in Unity using Netcode For GameObjects. We also used Lobby and Relay Gaming Services to make it easier to play with each other. There is only one ...
MrV's user avatar
  • 49
2 votes
0 answers
67 views

Background I'm making a platformer game, in C#, in Monogame. I've got a middling amount of experience with gamedev, having done some mini projects in Unity in the past and deciding I don't like a big ...
Jake Lawrence's user avatar
4 votes
3 answers
3k views

I am creating an ability system in Unity and it is currently able to update base values of stats and keep track of persistent buffs/debuffs while taking operation order into account (Add, Increase, ...
Psycho ZXC's user avatar
0 votes
1 answer
96 views

I am using unity as my game development platform. I was trying to create script that could interpolate time scale to achieve a flurry rush. The code below is my attempt: ...
pockspocky's user avatar
0 votes
0 answers
60 views

This is a follow-up question to coding capturing in Go. I have that successfully working. I am pretty sure that I am not reposting, this is a completely different question I have it just happens to be ...
unnamed's user avatar
  • 11
1 vote
3 answers
263 views

For the past month i've been working on a vr project and i wonder if i can obliged players to be on 90hz when playing the game because if player use 60hz then the game becomes laggy and since 90hz is ...
Moussaa 's user avatar
0 votes
1 answer
124 views

I'm a beginner developer and I'm currently working on a 3D game project with a third person view. When I implemented my first ActionMap into my character controller,...
qepo's user avatar
  • 3
1 vote
0 answers
119 views

I am creating a 2D procedural terrain using many Tile GameObjects. To make this infinite (and more performant), I dynamically load and unload chunks based on the players position and a variable ...
Pow's user avatar
  • 449
0 votes
0 answers
91 views

I have simple raylib code here: ...
SK19's user avatar
  • 123
0 votes
2 answers
85 views

How can I get complete path of a sprite? describes how to get a sprite path using UnityEditor.AssetDatabase which isn't available in builds. I need a way to get the ...
Goose's user avatar
  • 123
2 votes
1 answer
139 views

I'm working on a turn-based tactics game in Unity3D/C# in which players control Detachments composed of multiple Units. Each Detachment occupies one hex on a map, and may contain up to one each of ...
novawhelk's user avatar
0 votes
1 answer
96 views

What are my options with Unity to host a multiplayer server as cheap as possible? Preferable if it's also avaliable in Russia.
Треш's user avatar
1 vote
0 answers
91 views

I'm creating a game in C# with Unity. I want to know how I can send myself telemetry data (e.g. how long it took the player to complete the level) in the code in a way which is easy to set up and ...
Robin's user avatar
  • 724
0 votes
0 answers
98 views

I use a lot of path finding in my Monogame project which is taking a toll on the framerate, because in the worst case finding a path can take 200ms. So I looked into using Tasks to spread path finding ...
Depenau's user avatar
  • 111
0 votes
1 answer
85 views

Have an basic enemy prefab that when spawned, I would like it to lock to player and move toward them, with smooth rotation. However, as you can see in this video, the enemy initially moves away from ...
Anthony's user avatar
  • 11
2 votes
0 answers
103 views

I’m developing an accessibility app that allows users to navigate Windows using a game controller. The app works by using the left joystick to move the mouse and the right joystick to perform actions (...
DJx's user avatar
  • 21
0 votes
0 answers
47 views

Here is my script for opening animation. It basically sets the localPosition of an object out of the screen and then brings back in smoothly. The problem is I got ...
Said Polat's user avatar
0 votes
1 answer
53 views

When I first used it I remembered it as always calling the specific method once. So if I created a Jump Action with the key binding of space using SendMessage: and then created a method for it: ...
MrV's user avatar
  • 49
0 votes
1 answer
116 views

I'm creating a third person game with companions following the player. The companions have a mechanic in which if they are too far away from the player and out of camera view, they'll be teleported ...
Redsam121's user avatar
0 votes
1 answer
101 views

I installed the following extension: https://marketplace.visualstudio.com/items?itemName=woberg.godot-dotnet-tools but I'm not sure if it's actually related to autocompletion. I've tried turning the ...
shingo.nakanishi's user avatar
0 votes
0 answers
66 views

I have a c# udp socket I'm trying to send data from to my home. The server socket is hosted at aws, and the client is at my house. I modified the code from the following GitHub to send a response back ...
anthony's user avatar
0 votes
0 answers
83 views

I have 2 rotation matrixes than work in a world that have three dimensions (X, Y and Z) being Y the one of the height. One of such rotations works using Y dimension, from the point of the center of ...
user57129's user avatar
  • 133
0 votes
0 answers
45 views

I'm having a problem with the code below. My player is always moving at the same speed. Even if I give my boast variable a very small value, the speed remains same ...
Muhammad Hashim's user avatar
1 vote
1 answer
153 views

I have a circular GameObject in Unity 2D with a SpriteRenderer attached. I want to attach a custom component to my ...
Robin's user avatar
  • 724
0 votes
1 answer
64 views

I've used FromJson in Unity/C# a dozen times, and yet for some reason I cannot figure out why this one's not working. Here's the code that does the parsing: ...
rpatton583's user avatar
0 votes
0 answers
59 views

I am trying to make a 2D renderer using OpenTK and I am having trouble with the coordinate system. I have followed an opengl sprite tutorial and the Size vector is ...
flowxrc's user avatar
0 votes
1 answer
224 views

I'm working on a 3D game in Unity that requires lock-on, or Z, targeting found in games like Dark Souls and Legend of Zelda: Ocarina of Time. The code that I have achieves my intended goals fairly ...
FireStriker's user avatar
1 vote
0 answers
27 views

I’m trying to recreate the DCPU-16 for Unity that has a console and can render the output to a TMPro text on a canvas. What the code should do is display A B C onto the TMPro text, but nothing appears....
Joshua Blankenship's user avatar
0 votes
0 answers
30 views

When connecting a Character Controller component to the character in Unity, it starts to rotate uncontrollably. Without the Character Controller, everything works fine, but the character does not walk....
Pixel Play's user avatar
2 votes
1 answer
226 views

I'm trying to instantiate prefabs in Unity, but I want to do it from a script that doesn't inherit from MonoBehaviour. I understand that a ...
CheckerT's user avatar
  • 176

1
2 3 4 5
170