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
2answers
13 views

Unity2D Sprite flips camera when moving left and right

I am using the Unity Engine and coding in C#. I have a sprite as a parent with a main camera as a child so that the main camera follows the sprite. However, when pressing 'A' and 'D' to move the ...
-1
votes
0answers
25 views

Where should I start individual development? [on hold]

I'm not completely sure if this is the correct place to post this, but I need some guidance. I'm 15 years old, and a sophomore in High School. I want to either be an electronics technician or a game ...
-4
votes
0answers
16 views

C# Game with Windows Forms Graphic [on hold]

Hi i'm making simple c# game , and I like opinions is it good for a beginner Here is the link of the game . (link removed) Feel free to give your critical opinion
0
votes
0answers
21 views

Whats causing this weird texture stretching on my mesh?

Making this mesh via code and the texture seems to only tile on the sides, but not on the top. Any idea whats going on? public class CoreMeshCreator : MonoBehaviour { //Initialization public void ...
0
votes
0answers
19 views

XNA 4.0 - Using premade .xnb font files

Basically, for our college project, we need to use a font in xna. The only problem is that we are not allowed to install it due to admin rights. Is it possible to use and load the .xnb file that gets ...
-1
votes
1answer
28 views

How do I make my character run infinitely? [on hold]

I got my character running right (can't run left) and jump but I don't know how to make him run infinitely can anyone help? using UnityEngine; using System.Collections; public class Player: ...
0
votes
0answers
15 views

Unity - Get Local Mouse Position from the center of the Gameobject clicked on

I want to get the mouse clicked position from the center of the gameobject, say a Sphere of Scale(1, 1, 1), for instance. If I click on the center of the sphere it should return the x component as ...
1
vote
1answer
48 views

How do I make my character stop going left? (Unity)

So I have this code and my character can go left, right and jump. I don't want the character going left , so how can I remove that. (I'm very new with coding) using UnityEngine; using ...
3
votes
1answer
51 views

Determine if an object is inside a ship's turn radius, rotation via torque

I have a 3d space game where all ships move around using physics. I am trying to determine if a given object is reachable by a ship at a given velocity and turn radius. I believe the formula for turn ...
1
vote
1answer
18 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 ...
1
vote
1answer
47 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 ...
-2
votes
0answers
16 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
56 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
12 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
34 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
17 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
1answer
38 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
46 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
57 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
27 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
37 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
2answers
40 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
23 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
84 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
432 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
52 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
46 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
270 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
38 views

Rotation problem with Quaternion.Euler in unity [closed]

void Rotate() { Vector3 lastDirectionInGlobal = _camera.ScreenPointToRay(rightFingerLastPoint).direction; Vector3 currentDirectionInGlobal = ...
0
votes
1answer
58 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
39 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
82 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
59 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
47 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
33 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
28 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
62 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
57 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
46 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
84 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 ...