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
54 views

How to implement rogue-lite skill system

I am creating a roguelike/lite game where in a player has a freedom to learn a number of skills. For example, I have a projectile skills and I can learn three different behaviours. Behavior 1: shoot ...
PeytonFarquhar's user avatar
0 votes
2 answers
42 views

NullReferenceException whilst trying to set a Sprite on an Image component programmaticaly

I'm trying to create a prefab to instantiate things in a research tree, but when I try to set the text for the TextMeshPro text and the sprite for the Image, I get the following exception: ...
CodeWizard777's user avatar
0 votes
0 answers
17 views

How to make Cardial Directions relative to the camera

Lets suppose tha my movement method my W goes towards north(just figuretvly) and my E goes towards east, If I rotate my camera to east I want my W to insted goes to north, goes towards east and my E ...
Jamelaumn's user avatar
0 votes
1 answer
13 views

Can I insert sound in the tooltip?

Before this, I try to insert an image in a tooltip and it was already done. But right now, I want to try to insert a sound in the tooltip. What I want to do is when I point my cursor to the object it ...
Hidayah__0111's user avatar
0 votes
2 answers
48 views

3D First person Rotate Character Unity

I'm facing the problem that my chacter is spinning around itself when I try to move, that's because Im trying to make my player move in the direction of the camera, but when I move it keeps rotating ...
Jamelaumn's user avatar
0 votes
1 answer
32 views

How do I make my player rotate in the current direction of my camera in Unity using C#?

I have a player with third and first person camera, I want to make my player move in the direction that my camera is looking at when I hold the right mouse in third person and move(Like my player is ...
Jamelaumn's user avatar
0 votes
1 answer
22 views

Physics.CheckSphere not accounting for changes to object transform

My current project is a turn-based board game in Unity. Here is what I am trying to accomplish and the issue I am having: In Start, I generate the board, then populate the surrounding area with ...
Meuktwo's user avatar
0 votes
1 answer
57 views

How can I make the sound of a bullet crossing next to player?

I need to make the sound of a bullet crossing next to player, I tried by placing a hidden cube and make it a trigger, and when the bullet enters it, a sound must be played, but it didn't work because ...
Ahmed Dyaa's user avatar
0 votes
1 answer
40 views

playerOne.Score += 1; isnt working when my player picks up a item?

so currerntly i am working on a game just uses visual studio using C# but i have a issue where the player picks up a coin but it is not added to the score any reason why this would be. ...
charlie's user avatar
  • 11
0 votes
0 answers
21 views

RigBuilder.Build() Bug

When I call rigBuilder.Build() in my script it converts all rig weights in the scene to zero. But when I call it like ...
Ahmed Dyaa's user avatar
0 votes
2 answers
38 views

Display image by using tooltip

I want to display the image using a tooltip. So when I point to the 3dobject, it will display the image that I already created. Right now I already set the sprite in the tooltip but I have an error in ...
Hidayah__0111's user avatar
0 votes
0 answers
34 views

Any tutorials/advice on how to make a Super Mario 64-esque mission menu on Unity2D? [closed]

I'm making a 2D Collectathon game (featuring the character on my pfp) and I've been looking for quite a while (2 days actually) on how to make a mission menu similar to Mario 64/Sunshine/Galaxy where ...
user avatar
0 votes
2 answers
114 views

does it matter to send less data over network in a realtime multiplayer game?

I know it matters but... i know in networking there are packet size limits. for example, most UDP libraries enforce max packet size of around 65535. can I write on the network as much as possible ...
virtouso's user avatar
  • 2,526
1 vote
0 answers
69 views

Deflecting projectiles back towards enemies

I am working on a 2D side scroller. I have created an enemy character that shoots at my player randomly within a specific time interval. So, I want to deflect the projectiles back toward the enemy ...
Vrishank's user avatar
0 votes
1 answer
56 views

How to glue objects together so they move as one?

I'm making a puzzle game and can't find ANY solution on how to glue parts so I can move them together as a unit. :( I tried to making them depend like parent and a child, but when I touch the child, ...
Dead Lord's user avatar
0 votes
0 answers
34 views

List is keep adding the same items over again and how to make the textfield width to be fixed? and fix List adding the same items over again

This is the default window when opening it , it's showing gameobjects with scripts , each gameobject and the script attached to it. now the problems: when I'm typing in the search field for example ...
shlomi eshel's user avatar
0 votes
1 answer
42 views

How to check if one object's local bounding box contains another

I am currently trying to check whether the first object contains a second. I first tried to use the bounding box, but it is defined in world space, so it is not working with my rotated cubes. Then I ...
Muhammad Faizan Khan's user avatar
0 votes
2 answers
62 views

Struggling to launch my player backwards after it comes into contact with an enemy object

I am pretty new to Unity... watched quite a few of Brackey's and other YouTube videos along with a lot of research. I have been trying to add an impulse to my player so that after it comes in contact ...
Vrishank's user avatar
0 votes
1 answer
44 views

How to reference assets between multiple asset bundle in Unity?

I am trying to figure out how to properly package my bundles. My goal is to try and avoid necessary duplication of assets and cut down on download time of the assets by having smaller bundles. The ...
Ivan's user avatar
  • 185
0 votes
1 answer
22 views

How do I spawn the tiles on the global z axis instead of local z?

I'm trying to spawn infinite tiles in a 3D runner game, but the tiles are spawning at the wrong position and on the wrong axis. Technically, the code is working as it should, it is spawning and ...
Aj_Xocan's user avatar
0 votes
0 answers
17 views

In Unity 2021.x.x I cannot change value of array item of scriptableobject on Editor Window

So in Unity 2021.x.x I cannot change value of array item but on 2020.x.x it can change. Below the simple example to explain the problem, I can add an item of ...
Restu's user avatar
  • 1
-2 votes
0 answers
30 views

How to replicate leaping slinky motion?

I want to replicate the movement of the spring-like stack of rings in this game (Smash Race): How can I create this kind of movement in Unity?
Ajeet Prajapat's user avatar
0 votes
1 answer
34 views

When loading only one item from the asset bundle in Unity, does the whole asset bundle need to get downloaded?

I am deciding on how to package my asset bundles that will be loaded from the web server at some point in the game. Currently I am thinking of packing them by types: for example, I would have one ...
Ivan's user avatar
  • 185
0 votes
1 answer
63 views

Unity & Google Play Game Services - error: Leaderboard not found

My game uses Google Play Game Services for leaderboard management. In my production build, submitting high scores to and requesting the leaderboard for display from Google Play Games services works ...
ChrisC's user avatar
  • 104
0 votes
1 answer
22 views

ScrollView in editor window never reaches the bottommost items

...
shlomi eshel's user avatar
0 votes
0 answers
43 views

How to launch a soccer ball on a parabolic path in a 2.5D game?

I am trying to make simple 2D soccer game in Unity, but I feel a top-down view in such simple games isn't as exciting as the pseudo-3D view in games like Kunio Kun Nekketsu Soccer League. I am trying ...
Karlsson's user avatar
4 votes
1 answer
282 views

Find a encircliement in Hexagonal grid (optimization issue)

I have a hex grid of 10000 cells (100x100). The player can grab a cell next to one of his cells (borders). If the player has formed a ring after placing a cell, I want to get a list of cells that ...
ArtemiZ Studio's user avatar
-1 votes
0 answers
18 views

Error when I build WebGL Unity [duplicate]

I'm a newbie, i want to up my game on itch.io but i can't build Web game Everyone hepl me! please ! Thask everbody for reading my ask
Stone Lobozinho's user avatar
0 votes
1 answer
56 views

How do I make an object move to a certain location when the player looks at it?

I want to have an eyeball that when the player looks at, it disappears by moving to the side. Like in a horror game. I know how to make the object move to a set location but I don't know how I would ...
Dawid's user avatar
  • 3
0 votes
1 answer
84 views

How do pick up nearby items only?

I am trying to build an inventory system to pick up items depending on arrays. But the problem is when I pick up an item, all other items are picked up together. I want to collect each item alone. ...
user avatar
1 vote
0 answers
28 views

Set hologram position to the corresponding position of an object the mouse is hovering over, but offset is doubled for some "mounts"

I am making a factory game and for it I need to set the position of a hologram of a machine so that the end of the hologram's conveyor snaps to the end of the machine next to its conveyor when ...
Commander Of The Wind's user avatar
0 votes
0 answers
22 views

Adding to view angles in unity?

I'm trying to make a save/load position script in unity. I have coded the position portion but how would I go about doing this for a camera? ...
john_goshan's user avatar
0 votes
0 answers
49 views

Unity SetActive(true) not working for panel

So I have a finishMenu that I'd like to activate when the player finishes the level. I have a UI container (canvas) that contains among other things, my finishMenu. When colliding with a finish pad, ...
View's user avatar
  • 1
0 votes
1 answer
42 views

OverlapCircle detects collider farther away than the provided radius

Small Context. Moon - Projectile. Eye - Magnet that rotates on z axis and causes projectile to rotate too. On the first screen ...
Taras Fityo's user avatar
0 votes
1 answer
38 views

Rotating on Z axis with easing

I am stuck with rotating a GameObject on the Z axis with easing. I want to achieve an effect like in this game: Here, the ring of targets starts rotating periodically. It starts slower, than ...
Taras Fityo's user avatar
0 votes
0 answers
30 views

ReorderableList - Seemingly forced to get element's SerializedProperty in a weird way

I inherit from this and then make instances of the children: public abstract class Connection : ScriptableObject { public State nextState; } And then I hold ...
ruge's user avatar
  • 1
0 votes
0 answers
41 views

Design Pattern for Server and Client Objects in Unity Netcode

I'm struggling with how to solve the general problem of having a server-side GameObject which does most of the work and a client side object that's coupled with it for UI purposes only. As an example, ...
Alec McKay's user avatar
0 votes
0 answers
110 views

Change textures dynamically on 3D animating object in runtime

I have the following situation, where in I need to animate textures on 3D animating plane in runtime. There are 5 panels in the unity scene and two buttons, each button, when clicked triggers one ...
Omkar P's user avatar
0 votes
0 answers
26 views

Unity Thought There Was No MonoDevelop In Scripts in My Code

Weird Unity thinks that the code that I've checked already has a MonoDevelop inside of it, but unity doesn't think so, can you help find what I wrote wrong in these two scripts? ...
INDO_GEMENG's user avatar
0 votes
0 answers
14 views

IsTouchingLayers() does not detect collision

I'm making a tile-based player controller for a top-down game that first throws out a "move point" transform to see if its path is clear, then moves to it if the move point does not collide ...
littleknown's user avatar
0 votes
1 answer
56 views

Unity ObjectPool<T> CountActive is not decreasing after a destroy is called

I have made a loop to spawn and despawn a basic sphere gameobject. The issue is that when spawning goes over the max size, it does not decrease the ActiveCount when ...
Methalous's user avatar
0 votes
0 answers
45 views

How to hide part of character under slope

As shown in the image below I'm trying to find the points in which a line in the world space intersect a sprite. The idea was to get the corresponding values inside a shader to play around with pixel ...
Leggy7's user avatar
  • 1,454
0 votes
0 answers
31 views

my vr game bacame like 2d

I made a multiplayer VR game with normcore, but I had an issue. When I opened it in my quest 2, it became like a 2D game or like watching a screen. I'm not sure why this happened, but it looks like a ...
Mohammed ALGorrah's user avatar
0 votes
1 answer
42 views

Mouse-Click Movement Using Unity NavMeshAgent Causes Stuttering Upon Reaching Destination

Alrighty, so I've seen a lot of stuttering-related questions about NavMeshAgents but my problem is a little specific to my use case since it has nothing to do with <...
NicCantCode's user avatar
0 votes
0 answers
27 views

How to map south button on gamepad to behave like the left mouse button?

How would I tell Unity that the left mouse button is being pressed when I actually press the south button on a gamepad?
sadececaba's user avatar
0 votes
0 answers
25 views

Rotating Body Sprites of Snake depending on Direction Moving

Saw a thread with the same issue, but didn't seem like the question was answered: Snake Game body rotation As shown in the above thread, I have a Snake game that I'm developing for a project. I have ...
raining's user avatar
0 votes
1 answer
28 views

How do I select more Raycast Mask layers for XR Ray Interactor at run time?

I want to select more layers for Raycast Mask at runtime when I click a button. I tried GetComponent<XRRayInteractor>().raycastMask. but couldn't find an ...
Craving_gold's user avatar
0 votes
1 answer
37 views

Noise in compute shader related to threadsPerGroup

I have been working on a metaball compute shader for roughly 3 months now, and the only issue I have to resolve is noise in the output Dest[id.xy]. I also asked GPT 4 about the crux of the issue and ...
rasputin's user avatar
0 votes
0 answers
34 views

Both players turn around at the same time

i got the main camera following the players but once a player rotate to left or right the other player would do it too at the same time. I noticed that the event happens on void Turning() (on the ...
RandomNoobDev's user avatar
0 votes
1 answer
48 views

How to add visual movement to a car's wheels?

I'm fairly new to Unity and game development in general, I'm trying to build a basic car and give visual movement to the wheels. The car controls are pretty basic: accelerate "w" key, turn ...
Daniel's user avatar
  • 11

1
2 3 4 5
163