Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

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

0
votes
0answers
17 views

Melee Attack System [on hold]

So im creating a melee attack system for my game, I've seen a lot of variations to make an attack system, but I dont know what would be the best for my case. I'm making a game where the main character ...
0
votes
0answers
10 views

Unity: Get excel type data from an html website

So is there a way that I can use an html page as a database? My end goal is to put everything into an excel sheet that the people I am making the application for want. I need to upload data from the ...
-2
votes
0answers
21 views

Unity job is fail error [duplicate]

didn't have a problem in advance but after updating the unity and adding the unity ads I started getting this error. please help.
0
votes
1answer
51 views

Unity & CSharp - Placing Instantiated Object in the Direction of Player

So, I am making a Minecraft ripoff. I have a raycast that hits a block. It then places a block inside of that block. I am trying to make it place next to the block in the direction the user is facing. ...
0
votes
0answers
10 views

Set specific animator-state as more important

I have a animator with 3 states: KnifeWalk KnifeIdle KnifeAttack The KnifeAttack state should be run, whenever the bool "Attack" is set to true. This always ...
1
vote
2answers
50 views

Trying to set up a planting and harvesting system, but it only works in one trigger area?

What I want to happen is when the player presses alt, some time passes and an object is instantiated there. I also want it so that the player can't instantiate another object there until they've ...
0
votes
0answers
20 views

NullReferenceException until tile is spawned [duplicate]

I have a tile and tile has enemies spawn positions, and spawner script in it. Everything works fine when tile is spawned, my ray hits the collider in tile and enemies get spawned, but my spawn script ...
0
votes
1answer
35 views

why is GetComponent<ICameraControl> returning null?

As you can see in the attached image below and the code, I have added a class that implements the interface ICameraControl attached to a ...
0
votes
0answers
37 views

How do I disable user input after the player made their choice?

I'm trying to make a PvP minigame where both players have to chose 1 out of 3 options, but to avoid spamming I want to make it so that when a player presses a button, he is locked in that choice until ...
0
votes
0answers
12 views

Eerror:Win32Exception**: The specified module could not be found

I am trying to integrate Kafka in unity game and for this reason, I created a consumer client (Code given below). ...
0
votes
0answers
63 views

How can I optimise my game and its game objects?

I have a 3D game in Unity and I use blender to design models for it. My game has a feature where if you click a button, an object is cloned. An example from my game is a tree that is cloned around 100 ...
2
votes
0answers
21 views

What is causing a SIGSEGV in mono_class_vtable_full in Unity for Android?

I'm a developer of a mobile game, and we have Crashlytics in our game. For the latest release for Android, we are having crash reports with the following stack trace, for a number of players: ...
0
votes
0answers
18 views

how do I instantiate something with only the y axis rotation matching the instanciators y rotation

i'm making a swimming mechanic for my game and i need to instantiate the swim camera under neath the fps player when it hist the water. no mater what I try the swim cam wont have the same y rotation ...
1
vote
1answer
78 views

How to ease toward a rotation limit, instead of stopping abruptly?

I rotate my camera using a framerate-independent exponential ease-out blend like so: ...
0
votes
0answers
22 views

Greedy Meshing : Slow to rebuild when updating chunk

I've a problem with my voxel based game. The game is sliced into chunks (Like Minecraft), each chunk is 16x256x16 blocks. When I started the project, I used a basic culling system when hidden blocks ...
0
votes
0answers
16 views

How to detect two finger rotation Unity c#

I am trying to achieve rotating an object when two fingers are rotated on the Sensel morph touchpad. ...
0
votes
0answers
27 views

How to Create a Blast of Liquid in Unity

I am making a small cartoon-ish fighting game, and one of the weapons is a Hot Coffee Sprayer, which is a shotgun style weapon. How do I create a thick blast of dark liquid to come from it, with a ...
0
votes
1answer
26 views

how do I move an object based on rotation of another object?

This question is related to my other question about camera rotation. I hope its acceptable to ask a second question. I cannot figure out the math of how to calculate moving the camera to stay behind ...
0
votes
0answers
31 views

Making AI follow player in pacman game with grid

I have an AI that I want to navigate a maze in order to follow the player. I thought of creating a large grid with the help of FloatRects, so I do it like this: ...
0
votes
0answers
27 views

How can I stop my character's velocity in only one direction?

I'm moving a character by setting its velocity. It works perfectly and stops how I want it to however when I'm moving forwards and sideways at the same time and I stop moving either sideways or ...
0
votes
1answer
23 views

Two scenes load at once instead of only 1, Unity

so with my game i have two scenes one is my menu one is the game but when i click play on unity instead of using the main menu camera it uses the game camera while still showing all my buttons, As ...
0
votes
2answers
107 views

My camera does not rotate around player in 3d open world

I want my camera to following behind the player at all times. When the player turns to the left, I would expect the camera would move behind the player while remaining focused on the player. My ...
1
vote
0answers
20 views

How can I solve the “Unable to find back camera” error?

I'm trying to run a script that will display video from my webcam on my computer, but when I run it the error unable to find back camera pops up. My webcam is ...
0
votes
1answer
25 views

Move camera around player while facing player

My player has the following hierarchy: Hero (GameObject) Model (child of "Hero", centered at 0-0-0) Camera (child of "Hero") The camera should be ...
0
votes
1answer
45 views

How is this rotation done?

There is a video here that shows how the camera rotates around Leon. The camera rotates around Leon in a circle, this is not difficult, but I don't understand the timing logic. Once given a short ...
0
votes
0answers
25 views

How to stop Unity Camera from operating when UI Canvas is active

I've got a camera which uses the locomotion asset from the store and follows the camera. I've made a UI with buttons on it which I wish to click but the camera is locked to the center, when I press ...
0
votes
0answers
8 views

Controls don't work when parent or target moves

I have a platform for catching a ball. Platform physics material has bounciness value of 2 which pushes ball twice high from compared to its original position. Camera and platform have scripts ...
0
votes
1answer
31 views

Unet Syncing within AR Hololens

I am out of options. I have tried everything I could and no matter what I do, the Transforms don't sync up. I have had multiple solutions that worked in my test, non AR project, but once I put on the ...
0
votes
2answers
72 views

c# console based snake game

...
0
votes
1answer
30 views

Direct3D & Assimp Texture is inverted weirdly!

I'm working on a rendering engine but even on the first mesh is something wrong. I use assimp for mesh importing! In the Assimp Viewer it looks correct: And in my software it looks like this: Look ...
1
vote
0answers
24 views

Particle systems don't start unless I look at them (Unity)

I'm currently working on an atmospheric system in Unity (day/night cycle, weather). I'm having an issue where my rain/snow particle systems won't start unless I look at them. They're way up in the sky,...
0
votes
2answers
72 views

How do I get an NPC to follow the player(and stop when it gets within range)

I'm making a game where you have a friend follow you. I have a script that partly works, but when the friend exits the trigger, it won't follow the player. How do I get the friend to follow the ...
0
votes
1answer
37 views

Stop movement if transform.position.y == 0

Why does the following code not step the object's movement when its y coordinate reaches zero? ...
0
votes
1answer
41 views

Transform inputs don't work

I'm writing a C# player script for a class and when I run, the sound inputs work fine, but the movement inputs don't respond, and I don't know how to fix it. Code: ...
-1
votes
0answers
18 views

Object reference not set to an instance of an object [duplicate]

I'm writing a script for a game object, but I'm get an error message saying 'Object reference not set to an instance of an object', and it makes all my inputs stop working. Code: ...
1
vote
2answers
121 views

Why are my waves not spawning as expected?

Hey guys so here's an outline of my problem using a basic 3-step approach The Problem Defined Waves 1-22 should spawn in order with the correct paths and enemy prefabs. However, Waves 1-4 only spawn ...
1
vote
1answer
35 views

how do I set an int to the scroll wheel data in unity

i need to set an int to data from the scroll wheel so I can have the script use this int to display an item attached to a number from that int. i'm using c# i set up my scroll wheel input, what am i ...
1
vote
0answers
23 views

Discrete line inside a 3D matrix

First of all a little premise: I'm following this tutorial on YouTube for procedural 2d cave generation in unity using cellular automata and I'm extending it in order to make caves in all three ...
0
votes
1answer
113 views

c# snake game project

I am making a snake game. I have got it to animate. I just want it to follow the mouse pointer. I am able to find the mouse cursor position. I am also to get my snake to move to the right. What I want ...
0
votes
1answer
44 views

Visual Studio can't handle my unity scripts

I have created a new project in Unity 2018.3.4f1 with Visual Studio Community 2017. I can't edit scripts properly in Visual Studio because of a bunch of errors related to .net framework. How can I fix ...
1
vote
1answer
28 views

Create context menu in Scene view

I created some MenuItemfunctions for navigating, which are currently displayed on the menu toolbar. The C# code: ...
1
vote
2answers
59 views

Recursively calculate possible pathway on a grid depending on max walk distance

I have a character that is placed on a grid. It has a variable maximum walking distance. Grid fields can be walkable or not walkable. As the character may has to walk around certain not walkable ...
2
votes
1answer
44 views

How can I change view to orthographic using a menu?

I'm writing the custom menu using MenuItem and I'm stuck trying to make scene view orthographic when 5 is pressed. What is the ...
1
vote
2answers
62 views

How to achieve a stable hover in Unity

In the game that I am currently making the play character is supposed to hover off the ground. I had used the code from the Hover Car tutorial on the unity website however this causes a lot of ...
0
votes
1answer
35 views

Unity websockets client disconnects after server emits with data

I am using some unity "socket-io" plugin i found on the asset store. (its essentially just a scoket.io wrapper for websocket-sharp) everything works absolutely fine, i can catch clients connecting or ...
0
votes
1answer
44 views
0
votes
1answer
74 views

Manage massive items game data in an Android Idle Game

I'm working on an Android Idle game, with many items that user can buy in each level, that each of them has more than 50 levels who can be updated by the user. Each item in each specific level can ...
1
vote
1answer
58 views

Cannot assign values to variables (?)

I wouldn't say i'm new to unity or programming in general.. but right now i feel so stupid. I have a simple enemy script. I instantiate object with another script, calling SettingUpCreep and giving ...
-1
votes
0answers
41 views

Using a Singleton for an EditorWindow

I am trying to create my custom EditorWindow in Unity, using a Singleton structure for logic between Editor scripts What is the proper way of creating Singleton in EditorWindow structure? Maybe ...