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.

1
vote
1answer
66 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 ...
0
votes
1answer
34 views

Better way to handle speed able time and action in unity

I have came across a problem where i have to do some time based task(simulation) like, As the game started: After 2 mintues launch a missle. After 4 mintues star a train on track after 12 minutes ...
0
votes
0answers
32 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
20 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 ...
1
vote
2answers
108 views

Load character instead of load level

I have some trouble finding out how I can load my character at the start of the level, instead of resetting the whole thing. The game mechanics are quite straight forward; don't touch the walls. If ...
0
votes
1answer
57 views

C# 2D Perlin Noise Heightmap By Seed

I need a function of 'Perlin Noise' in this format: public int PerlinNoise_maxY(int seed, int x, int z) { // ... } The function gets Seed, X cordinent and a ...
-2
votes
0answers
22 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
31 views

How can the ball moving like billiard after collision with wall?

I tried ball.velocity = Vector3.forward * speed and also *=-1 when the collision is occurred(It only works for straight way. But I want the ball movement be liked in photo. How can i do it? Thank you ...
0
votes
1answer
37 views

SerializedProperty to UnityEvent in a Custom Editor

I am making a Custom Editor for a type that includes a UnityEvent property. I'm currently facing an issue in converting a SerializedProperty to get that UnityEvent. Here is how I declare the event ...
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
52 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
1answer
38 views

XNA 4.0 How to combine triangles vertices 3D

Preview for the problem: I'm making a similar game to Minecraft (a game that it's world is made by cubes), but the fps of the game is getting low only by rendering a little amount of cubes in the ...
0
votes
1answer
116 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
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 ...
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
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
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 ...
1
vote
1answer
79 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
1answer
31 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
2answers
122 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 ...
0
votes
0answers
64 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 ...
0
votes
2answers
72 views
0
votes
1answer
67 views

Server-side real time position calculation based on destination position - C#

What I want to achieve is to calculate the real object position based on its speed and a destination position. In my server, I have a MapInstance that have a list ...
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
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 ...
0
votes
1answer
4k views

How to instantiate an array of Prefabs in C# Script

Sorry if this sounds quite primitive, I am new to Unity. I am trying to instantiate an array of prefabs, but it doesn't seem to appear when I run the game. Firstly I created my block prefabs, then I ...
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 ...
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
17 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
28 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
104 views

Creating multiple levels in Unity without duplicating scripts

I'm trying to create a falling word typing game like z-type. I have used the code provided here I want to create multiple levels in the game, and it seems like I need to make some changes in the ...
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
1answer
27 views

Access a clone of an instantiated object - not all the clones?

I am trying to access the object I instantiate - basically a prefab car instantiates cars (one after one) ..the problem that when try to move one .. they all move together ... what's the best way to ...
0
votes
2answers
40 views

Unity - Instantiate GameObject from client on Network

I am building a game where a weapon shoots prefab bullets. I am trying to make this a multiplayer game, so the bullets need to be spawned into the Network. What ...
0
votes
1answer
26 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
46 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 ...
4
votes
1answer
1k views

Convert Minimap render texture to 3d space position

I am using Render texture to make a Mini Map it is working fine but now I want to go further on side map and want world space position from render texture click point. Is there any way available that ...
0
votes
2answers
73 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 ...
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 ...
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 ...
4
votes
1answer
3k views

Unity - Read pixels of camera into memory

I am trying to develop a bot in a Unity game that takes actions based on the image produced by the camera. I have attached a camera to the "face" of the bot, which is the camera I need to get the ...
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
3answers
256 views

Unity animation editor having trouble to animate twice the same component

I'm not getting warm with the Unity animation editor. This is what I want to do: The 2 lasers should be like this, rotating 360 degrees over and over. .The classname laser2 doesn't mean anything, I ...