C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

0
votes
0answers
23 views

Can Unity game be run as server?

Can my Unity game run as a server on a virtual private server? Also what about c# server compiled in visual studio? And would it be better to use windows or linux server? (linux would require mono)
0
votes
1answer
8 views

Animator has not been initialized

My animation is working but unity keep saying that my Animator has not been initialized error Here my Code: using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public ...
0
votes
1answer
25 views

Instantiation taking too long?

I have a game where there are about 4 empty objects that are my object "spawners". I have two scripts attached to all of them, one that will keep spawning objects from "basictable", and then switch to ...
-1
votes
0answers
14 views

Unity error CS1519 and error CS1525

using UnityEngine; using System.Collections; public class Player: MonoBehaviour { public float maxspeed = 10f; bool facingRight = true; bool grounded = false public Transform ...
0
votes
1answer
34 views

Task vs Thread with execution queue

My game server will have to respond to requests very often, so I consider threading a good option. But should I use Task class from .NET or have several threads that would execute requests which I ...
1
vote
1answer
8 views

Unity Inspector Not Showing Serialized Variables Of Child

So I'm new to using Serialaiziblewtfever(I just cannot remember the correct spelling). In the Unity editor it works fine if I have something like: [System.Seriliabizblewtfever] Public class ...
0
votes
2answers
30 views

I can't add script in unity

I'm a beginner in unity so I got this problem. Here is the script: using UnityEngine; using System.Collections; public class Playercontrol: MonoBehaviour { public float maxspeed = 10f; bool ...
0
votes
0answers
15 views

Errors Generating A Plane Mesh Using A Script In Unity

In unity I have a script which is attached to a game object with a mesh filter. The purpose of the script is to generate a flat plane of 100x100 vertices. The code for the script compiles in ...
0
votes
0answers
28 views

UNITY IEnumerator Function

So I am currently using the IEnumerator function to pause a for loop, the for loop that contains a ball that should move to another game object. Currently from my print statements seems like the ball ...
0
votes
1answer
32 views

I cant get my interface to work

This is my first time using interfaces so I imagine I'm doing something dumb. I have an interface called ILoadable inside ILoadable.cs; using UnityEngine; using System.Collections; public interface ...
0
votes
1answer
45 views

c# list that contains more then 3 lists [on hold]

How to create a list that contains more then 3 lists. If those lists change the "bigger" list that contain them also changes. public List<Rectangle> CoTree,CoRock1,CoRock2; public ...
0
votes
0answers
56 views

Making a command line in C# [on hold]

I was wondering if there was a way to code a command prompt type thing (CMD) for Unity in C#. I am making a hacking type game and tried but failed.
1
vote
1answer
24 views

Model texturing not seamless at certain zooms? (C# XNA)

I found a very odd glitch with my game this morning. XNA doesn't render certain textured models properly, while other models are completely unaffected. And it's not even like my models are made ...
1
vote
0answers
35 views

Calculate Orbit Path/Ellipse given mass, velocity, and distance (2body)

Calculate and draw the path of an orbit in a 2 body problem given the mass, current velocity, and distance of both bodies? We're working in Unity and will be using the default rigidbody.mass to start ...
0
votes
1answer
36 views

How to deactivate a button in unity 3d

We have a set of buttons in our game. Each one corresponds to a particular instrument. we have to implement the foll: a button should become deactivated after being clicked once implying that the ...
0
votes
1answer
22 views

Button detection in unity3d

we are developing a a game in unity 3D . To play the game we need a number of instruments. we have given a set of buttons to activate the instruments: each button corresponds to a particular ...
0
votes
1answer
27 views

Unity Issue with Vector3 and Transform

So I am currently running into this error Cannot implicitly convert type 'UnityEngine.Vector3" to 'Unity.Engine.Transfomr' I am not to sure on how to fix this issue because I am very confused on ...
0
votes
2answers
81 views

Creating a Timer in C# Unity

In my game I have watch video earn coins system, now I want to program a delay so the user cant watch the video every 5 seconds, for example I want to let him watch every 6 hours, but I'm not sure how ...
4
votes
5answers
420 views

How to Color.Lerp between multiple colors?

I have found it rather difficult to find a solution to this in the Unity documents. Color.Lerp(Color a, Color b, float t) is a function that gradually changes a color according to a step t, giving it ...
1
vote
1answer
50 views

Pause in Seconds and resume in unity

I want to pause 15 seconds then resume without any input when an object is collision other object this is my code but not working. Thank you void Start(){ Eifftower = ...
0
votes
0answers
45 views

C++ or C# for 2D Game Development [closed]

I am a python programmer since two years and I wanted to delvelop a REAL game now. So I decided to choose between C++ and C#. I should also mention that I mainly want to program games compatible on ...
7
votes
2answers
260 views

In Unity, why is adding a Vector2 and a Vector3 ambiguous but assigning isn't?

Given the following two vectors: Vector3 v3 = Vector3.one; Vector2 v2 = Vector2.one; This line is ambiguous: v3 += v2; // Unity reports dimension ambiguity whilst this assignment isn't: v3 = ...
-1
votes
0answers
36 views

Rotation problem with Quaternion.Euler in unity [closed]

void Rotate() { Vector3 lastDirectionInGlobal = _camera.ScreenPointToRay(rightFingerLastPoint).direction; Vector3 currentDirectionInGlobal = ...
0
votes
1answer
53 views

Unity forward vector flips when upside down. Mario Galaxy style gravity, bad rotation?

This is a question that I think is best to explain visually, so I will do my best to be succinct here. What I am trying to do: Allow the player to run about a world that is spherical, not a flat ...
0
votes
1answer
38 views

XNA - Darkening background and drawing something on top

In a game a group of friends and I are working on using XNA, we wanted to create an effect where we could darken the screen and draw something else on top of the darkened portion. For example, we have ...
0
votes
1answer
81 views

XNA game structure question

I see to be running into a problem here. I know it's easier to show code samples so here you go. This is my main game class namespace WindowsGame4 { public enum MoveDirection { Left, Right, Up, ...
-3
votes
0answers
58 views

How to make monster a collection system? [closed]

How to make monster collection system like this?: and Can you recommend any useful design pattern or examples?
0
votes
1answer
46 views

moving object in unity from a point A to point B no matter what the original position of the object is

I'm moving a Game Object in unity from point A to point B no matter what the original position of the Game Object is. Let us suppose that I have a Game Object at (0, 0, 0). But I want to move that ...
0
votes
1answer
32 views

XNA/MonoGame RenderTargets not working

I'm having a problem with drawing 2 RenderTargets to the screen. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using ...
1
vote
2answers
62 views

Drawing a pixel to RenderTexture

I would like to know how you would go about drawing a single pixel to a RenderTexture in Unity. In XNA, it was just a matter of setting the graphic device's active renderTarget, and drawing to it. ...
0
votes
0answers
24 views

swap rotation problem in mobile game (unity) [closed]

using UnityEngine; using System.Collections; [RequireComponent (typeof (CharacterController))] public class Camera_rotation_onSwap : MonoBehaviour { public bool kJoystikEnabled = true; public float ...
0
votes
0answers
27 views

Unity 5 profiler shows Vsync graph even if disabled

My game suffers from some lag spikes over time, wich match with the Vsync graph in the unity 5 profiler. I deactivated Vsync via script and the quality settings but the lag is still there and the ...
-1
votes
1answer
57 views

Why can't I access List<T> through System.Collections.Generic? [closed]

I have the following small and incomplete script, and I was wondering if anyone knew about this issue. I'm trying to access System.Collections.Generic.List<T>, but I keep getting the error The ...
-6
votes
1answer
61 views

MMO game made with Unity [closed]

this is my first post in stack exchange i am currently making a 2D MMO game with Unity 5 and Bolt engine for the networking but i realized that a friend of mine has already made a Fan based game ...
1
vote
1answer
54 views

Simple Tanks game - Client-Server communication approach doubts [closed]

I want to create simple a multiplayer 2D game with tanks ( cooperative ) in C# with .NET. I also want to keep it simple, because it is only a semester project, and unfortunately i don't have time to ...
0
votes
0answers
21 views

How can I change the gear of my 2D character? [duplicate]

Is it possible to change the clothes of a 2D character(it's a 2D Windows Phone game) without creating new animations for that character? I want that the player can change the clothes of the character, ...
0
votes
1answer
45 views

Calculate 3D “up” vector to align ship to an arbitrary axis

I'm writing a script to control the movement of a 3D ship in a game. Given the ship's position and the coordinates of the destination, I've successfully calculated the Yaw and Pitch necessary to aim ...
0
votes
0answers
26 views

Rotate the camera on a given angle

Good day! I apologize in advance for my bad english. The task is as follows: "On the stage there is a camera and a gun with rays when a ray gun out of sight of the camera (vertical) is required to ...
0
votes
1answer
36 views

XNA Rendering Blocks

I am currently building a little game in XNA and found something strange. I want to draw many blocks next to another (1x1x1 with a texture on the side) So what happens when I do it this lines ...
2
votes
2answers
82 views

How do I rotate and object around itself, and translate it at the same time?

I have this animated gif of my problem. I have a sprite object with a box collider, and I'm trying to rotate it around its center. My rotation script consists of this : this.transform.Rotate (0, 0, ...
3
votes
3answers
179 views

How to achieve high Level of Detail on 3D models

I'm developing a 3D space-based game which allows free movement in all directions and features planets. Currently I am using the Visual Studio content manager to import models (spheres) with 2D ...
0
votes
1answer
20 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 ...
-1
votes
0answers
25 views

how to add specific line when it cross another line?

two lines ; one of them cross the other, it is like collision between those lines, I need a method to detect collision between lines and how to put this specific line when we detect a collision! ...
1
vote
1answer
233 views

Switching renderer off/on for an object in unity using C#

I have a GameObject called 'Stone' that is rendered on Game Play. I have attached a C# script called RenderOff to to make 'Stone' invisible on Game Play. RenderOff.cs using UnityEngine; using ...
0
votes
1answer
30 views

C# - console application, array problem [closed]

I have problem in very simple console app, code looks like this. int x - player moving and changing axis "x" and I want make full history of moving via array. See code(only example) below... Thank ...
2
votes
1answer
718 views

What is AABBvsAABB Collision detection?

Currently studying Game Engineering at university and my lecturer has asked us to implement a collision manager. He asks us to use AABBvsAABB to build it, so then we can add the physics. My question ...
0
votes
1answer
78 views

Implementing FSM on multiple class UNITY3D

I am recently implementing design patterns on my project, while researching around I came across many advance techniques like HFSM ,Behaviour trees. I did implemented behavior trees wherever required ...
1
vote
1answer
16 views

Monogame - stopping a custom shader (drawable game component) when inside another drawable game component [closed]

I have run into a bit of trouble when using a custom shader (gaussian effect) within another drawable game component, as I cant figure out how to break out of the draw method, so the effect is applied ...
0
votes
1answer
90 views

Understanding Unity 5 Car controller

As with all Unity versions Unity 5 comes with a set of Standard Assets. This new set of Standard Assets comes with a Car Controller. Either by attaching a Car user controller script or a Car A.I. ...
0
votes
0answers
7 views

Cannot get the specific bounds of my Animation sprite?

I have an animated sprite on my scene, and I would like to scale it to the screen width/height. So on my scene, I thought I'd add a Rect Transform first to find out my object's size, turns out it's ...