Skip to main content

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
0 votes
1 answer
152 views

I would like to change the layer depth of objects, so that the player can go behind them. Right now it looks like this when the player is behind the object: The problem is that the layer depth doesn'...
Kuvaitt's user avatar
0 votes
1 answer
147 views

I am trying to create a function to detect mesh geometry irregularities — for instance, the mesh possibly contains a missing face or possible normal flip problem. To detect the missing face, I ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
117 views

This is a rigidbody-based movement script. I notice that it doesn't let you jump while you're running. This problem persists whether you are using new Input System or not (I tested both ways). Notably,...
yunum's user avatar
  • 69
0 votes
2 answers
93 views

I am trying to get the camera to rotate towards a location and position. Which works at the moment, but once it is done and re enables the mouse look script or bool in the script the mouse look ...
WestMansionHero's user avatar
0 votes
1 answer
122 views

I recently started rewriting my engine from scratch, because the old one was my first attempt and the structure was very messy. Everything has been going great, but now I'm being held back by some ...
Kuvaitt's user avatar
0 votes
1 answer
103 views

I've got the first part of the code working. It iterates and does a check through the gameobjects to find the furthest nav point to hit. Then it calculates path to see if its valid or not. Now I'm ...
WestMansionHero's user avatar
1 vote
1 answer
419 views

I can't find a quick answer anywhere, besides adding a 100 line script that I'm pretty sure is outdated. As the title suggests, I am trying to curve a grid layout group. I also want the children of ...
sammyiscuul's user avatar
1 vote
1 answer
375 views

My player is able to dive for a limited amount of seconds (let's say 10 seconds) while swimming. When he's not diving his breath gauge fills up again to a max of 10 seconds: ...
Tomo's user avatar
  • 133
1 vote
3 answers
432 views

I've been working on a custom enemy "AI", the way it works is it generates a point inside a colliders bounds, then moves the enemy towards the point. Once the enemy reaches it. The point is ...
Pow's user avatar
  • 449
0 votes
1 answer
68 views

I'm working on a 2D game, it has some basic combat but I want to spice it up a bit with some effects. First I added a flash when you get hit but I also wanted to add some particles. I thought it would ...
Pow's user avatar
  • 449
0 votes
0 answers
283 views

I have millions of objects that I want to render. I found that instantiate is not suitable, so I'm using Graphics.RenderMesh which is amazingly fast and light. But here comes the problem: it takes CPU ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
89 views

I'm making a custom inspector for my script, and I have an option to pick a KeyCode as you can see below However, now that I'm using a custom inspector, I don't know how to add a Keycode Field. I ...
Pow's user avatar
  • 449
0 votes
0 answers
50 views

I am trying to make a clone of florr.io (I'm not getting sued I know what I'm doing), assuming you don't know what that is, it is a game with petals rotating around you. I'm using a parent object ...
sammyiscuul's user avatar
1 vote
0 answers
180 views

I'm working on a custom inspector/editor for my player controller, the issue is every time I change something and click undo, the undo just undoes clicking on the object not modifying the value. After ...
Pow's user avatar
  • 449
0 votes
2 answers
192 views

I'm trying to make a randomized generation engine for a top down dungeon crawler, in the Binding of Isaac style, however, the code is throwing out a multitude of errors when I try it compare a value ...
Thirstierpoet17's user avatar
2 votes
2 answers
369 views

Experimenting with my 1st Unity project. It's about a top down swimmer. By toggling the swimmer's collider, he can swim under boats: ...
Tomo's user avatar
  • 133
1 vote
1 answer
168 views

I'm working on a rhythm based android game similar to Guitar Hero. I have a kinematic rigidbody moving downwards with tapobjects (colliders) inside which need to be pressed when moved above the button....
delato468's user avatar
  • 111
0 votes
1 answer
67 views

After my character spawns, the camera just stays in the same place. How can I solve that? Here's my code: ...
TheEpikDuck's user avatar
0 votes
1 answer
106 views

I am creating a game where there would be two objects instantiated. Each one has a script (to check for collisions), a Rigidbody2D component and a ...
Saharsh's user avatar
-1 votes
1 answer
46 views

This is in 2D by the way. ...
sammyiscuul's user avatar
1 vote
0 answers
53 views

I am having a problem importing code from a 3rd party asset into my project--this is an asset I purchased off the Unity asset store. I did contact the vendor but haven't heard back. The error I am ...
tatmanblue's user avatar
-2 votes
1 answer
113 views

I am trying to make a coroutine private in Unity. I have tried declaring it as a private method, but it still seems to be accessible from other classes. Here is an example of the code I am using: <...
Alex Junior's user avatar
0 votes
2 answers
212 views

I'm creating a game in unity for my school project similar to a mobile game called Traffic Racer which is essentially an endless runner. Due to my current scripts, I need to spawn the road at the end ...
menaktee's user avatar
0 votes
1 answer
1k views

When I run this script in Unity: (ignore the clones variable) ...
sammyiscuul's user avatar
0 votes
0 answers
183 views

My question is more C# than Unity, but it relies on a Unity specific delegate, also, sorry if the title is not that clear to what I'm trying to do. I have implemented a simple event manager which uses ...
Daniel Guiomarino's user avatar
0 votes
1 answer
68 views

...
Nader Amir's user avatar
12 votes
3 answers
6k views

How can I setup a Godot 4 project in the way of a "classical" software project? With a Main function. Openable in any IDE. Compiling to an executable file ...
Zsar's user avatar
  • 245
0 votes
0 answers
142 views

one of my players always, consistently get a NullReferenceException in a "will be destroyed" behaviour. No other report were sent (they are automatic). Only from that device and I couldn't ...
Tudvari's user avatar
  • 801
0 votes
1 answer
55 views

I have a 3D object, a blade, that I want to rotate continuously on the x axis, like it's cutting through something. I also want the player to control its z-axis rotation by swiping. It's mainly ...
Nader Amir's user avatar
0 votes
0 answers
345 views

when the host try to move it works perfectly fine, but on the client, the client player does not move ...
Jamelaumn's user avatar
1 vote
1 answer
183 views

I have the following case: I have a class called App.cs and here I have a function called Render, that runs once every frame: ...
Bogdan's user avatar
  • 111
0 votes
1 answer
346 views

I would have liked to comment on this answer, but I don't have enough reputation so I had to open this new one. The issue with it (and with the rest of the answers) is that it doesn't work well if ...
vandermies's user avatar
2 votes
1 answer
91 views

I'd like to refactor my pooling class to work for more object types in my top down Unity game. Right now it's working fine for player projectiles, but I want it to also work for enemy projectiles, ...
Aloof's user avatar
  • 21
0 votes
0 answers
102 views

I'm trying to Automate a Task which involves commending a player in a specific server (unofficial custom server), I looked into several open source project but all of them are deprecated and archived ...
AliSalehi's user avatar
  • 101
0 votes
1 answer
170 views

I'm making a building game in Unity and C# I want to be able to scroll the screen in all 4 directions when in building mode. At the moment, I can rotate the camera and scroll the screen left and right,...
Guybrush Threepwood's user avatar
0 votes
2 answers
157 views

I'm trying to make a 2D Unity platform game for a school project, but I can't seem to get the enemy to move. ...
TheEpikDuck's user avatar
1 vote
1 answer
548 views

We are developing an economic sandbox somewhat similar to a mixture of The Guild and Kenshi. In this game, both the player and the NPCs will often create and destroy (consume) various objects. The ...
stack_ndx's user avatar
1 vote
2 answers
106 views

I need a way to carry objects on top of other objects in VR without jitterness causing the objects to fall through a tray for example. I've tested with rigidbodies having very high friction, this does ...
Richard Muthwill's user avatar
0 votes
3 answers
573 views

I'm using Unity's latest Splines package(v2.5) to move a projectile across a spline with speed. It works perfectly and the projectile moves across the spline to it's target with linear speed. But I'd ...
PayasoPrince's user avatar
0 votes
1 answer
150 views

So in the following code: ...
sammyiscuul's user avatar
0 votes
0 answers
278 views

I have an Unity app that requires a stable fps in editor. The fps itself is really high anywhere from 200 to 280 the problem is that is not consistent. I tried to limit it with the code belove but it ...
Ivan's user avatar
  • 379
2 votes
1 answer
280 views

I'm wondering if there is a way to detect if the key being pressed is NOT matching a specific KeyCode. I tried using: ...
sammyiscuul's user avatar
0 votes
1 answer
156 views

So I have no idea if there is a way to do this, but I'm trying to find a way to turn an alpha number in a game object name string into an Alpha key code, which I'm going to use in an Input.GetKey. ...
sammyiscuul's user avatar
17 votes
3 answers
6k views

I decided to learn about building games, so I picked up C# to use it along with Windows Form - I already have C# experience, so that was the main reason I did so. That said, I tasked myself to build a ...
curiousguy_08's user avatar
1 vote
0 answers
106 views

I've got a problem with my undo system that ive made, the idea is I want to make a sort puzzle game like this => https://www.youtube.com/watch?v=VdXi9UQhOng WHAT I UNDERSTAND There is some ...
YouCanCallMe Syarif's user avatar
1 vote
1 answer
131 views

I've got a problem with my flying AI in Unity. When it just chases a target it's ok, but my system contains avoiding obstacles so when it starts to do it, it shakes weirdly. As I understood using <...
kotan4ik's user avatar
1 vote
1 answer
137 views

I'm somewhat new to Unity, so I'd like to hear some more experienced thoughts on this. I'm using C# if that helps. I'm currently working on an arcade game somewhat similar to "Doodle Jump" ...
soxyo's user avatar
  • 13
0 votes
1 answer
1k views

I am trying to load, at run time, a UI prefab and have that display on a canvas. I was following the directions found on this forum. I am able to get it to load and display, but it is not showing up ...
tatmanblue's user avatar
0 votes
2 answers
242 views

I have an direction that I want the local player hub & camera to rotate at. The game handles this by using euler angles which Y represents the hub rotation on the horizontal axis & X ...
Xprt's user avatar
  • 3
2 votes
2 answers
268 views

Say I have an agent in 2D in a world filled with circular obstacles of different kind and across many scales (some may be very large, practically filling an agent's view, some may be very small). The ...
kram1032's user avatar
  • 121

1
3 4
5
6 7
170