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

-2
votes
1answer
13 views

How to make monster a collection system?

How to make monster collection system like this?: and Can you recommend any useful design pattern or examples?
0
votes
1answer
22 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
0answers
13 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 ...
0
votes
2answers
34 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
13 views

swap rotation problem in mobile game (unity)

using UnityEngine; using System.Collections; [RequireComponent (typeof (CharacterController))] public class Camera_rotation_onSwap : MonoBehaviour { public bool kJoystikEnabled = true; public float ...
0
votes
0answers
20 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
46 views

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

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

MMO game made with Unity [on hold]

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 ...
0
votes
1answer
41 views

Simple Tanks game - Client-Server communication approach doubts

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
20 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
38 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
24 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
0answers
31 views

Impassable Tiles With XNA/C# [on hold]

I can't get this to work for the life of me and I'm not entirely sure why, as I'm checking whether the tile is passable or not. I have a Tile class which contains a tileIndex, a tileSet and a boolean ...
2
votes
2answers
73 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
117 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
19 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! ...
-2
votes
0answers
79 views

unity 5 C# or Unreal Engine 4 C++ [on hold]

now with unity 5 and unreal engine 4 both going for AAA graphics(unity) and free(UE4) which is a better choice...i have been working with unity for the past year and C# is boring to program...UE4s C++ ...
1
vote
1answer
224 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
29 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
700 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
66 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
65 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 ...
0
votes
2answers
65 views

Help on transition from one position to another

I'm pretty sure I'm over thinking stuff, but I can't seem to figure this out. I want to move the object from one location to another. Here's what I got. I searched this up earlier here, and I found ...
0
votes
1answer
27 views

Instantiate a prefab and call a method from it's script

I am creating a game in unity and I have a prefab that I instantiate on center occasions. What I want to do though is after instantiating the prefab. Get a handle to it and call a specific public ...
0
votes
1answer
35 views

how to stop camera at the end of world map when zoomed in

Im building a tile-based game, and Im trying to implement zooming in on the center of the screen. My problem is, when I get to the edge of the map and im zoomed in, Im noticing that my camera doesn't ...
0
votes
1answer
64 views

Draw many flashlights' focused lights' “circles” on a voxel engine map (and other objects)

So, I've been searching the internet for a while and I still didn't understand how to create a flashlight's "circle" in front of the camera over other objects. I found the following links: using ...
0
votes
1answer
28 views

Instantiated Prefab Facing Wrong Way

Here's a Youtube video of my problem in action ((in the video I am clicking in various directions, yet the fireball is always created facing down in some direction.)) I've been having a lot of ...
0
votes
2answers
33 views

Unity 5: Error when everything is okay(Object reference not set to an instance of an object)

i'm getting this error when the collider colides with something: Object reference not set to an instance of an object It's referencing to the gamecont.Death(); from this script: and the death ...
-1
votes
2answers
68 views

The Validity Of “Else-IF” in Unity (Or any C# for that matter) [closed]

While I'm speaking specifically for my use in Unity, I'm sure this question probably applies to C# in general. I've seen a lot of debate on the use of the "else if" statement. Particularly, I'm ...
1
vote
1answer
38 views

Finding flexible patterns in a 2D grid

I'm stumped trying to create a matching algorithm for my game. I have a 2D grid like this for example: 0, 0, 0, 0, 0, 0 0, 1, 2, 2, 1, 0 0, 1, 1, 0, 0, 0 0, 0, 2, 0, 1, 0 0, 0, 0, 2, 1, 0 0, 0, ...
1
vote
1answer
66 views

How can I keep AI from getting stuck on each other?

I'm currently working on AI and, as stated above, I'm having trouble figuring out how to keep the AI from getting stuck on each other. More specifically, I'm working on two different behaviors for ...
1
vote
1answer
40 views

Unity sprite with higher sorting layer not firing its OnMouseDown function

I have 2 objects, both have a Box collider 2D. The first object is on the Level1 Sorting Layer and has a Tile script attached to it. The second object is on the Level0 Sorting Layer and doesn't have ...
0
votes
1answer
22 views

XNA C# Texture Atlases

Fairly new to XNA and not an expert on C# either. So I was following a tutorial, specifically this one http://rbwhitaker.wikidot.com/texture-atlases-1, and there is a bit of code I am unfamiliar with. ...
0
votes
1answer
61 views

2D game world engine

I'am starting to develop a 2D game with snake or worm. My question now is: When my snake reaches the right edge the world should move. (Like in this game) My first thought was to implement a camera ...
0
votes
1answer
79 views

Pixel Shaders To Create Predator Effect

I am learning shaders, and I figured I would try to use them to create sort of a predator effect. I got to the point where I rendered my level to a rendertarget and passed that to the shader file, ...
2
votes
1answer
63 views

Speed needed to make a car jump from a ramp

I need to make a car jump from a ramp to another, and I need this to be done using AI so I thought it would be enough to set a fixed speed for my car when near the ramp, in order to let it jump ...
0
votes
0answers
33 views

How to make Unity3D Camera focusing on one area?

In my Unity3D project, I have a board created dynamically (using c#) and located on the screen as follow: 0 < x < 12 0 < z < 12 y = -1 How can I make the camera focusing on the board ...
0
votes
1answer
47 views

What is the recommended way to store game entity data? [closed]

The following is specific to my problem, but I believe the principles can be applied to any game. I am currently working on a 3D game which will have many different types of spaceships. The physics ...
1
vote
1answer
121 views

How should we be storing procedurally generated behavioural code?

Me and a group of friends are developing a game and we've run into a road block. Before we describe that road block, here's a simplified explanation of our game: The game will be able to take in a ...
0
votes
3answers
78 views

Simple way to shoot bullets from a ship at angles for shoot em up

Just like the title says. I'm working on a shoot em up for a personal project, and I can't seem to get this to work. I don't have any code for it, but I do have the code to make my ship shoot, but ...
1
vote
1answer
22 views

How can I draw some of my XNA models semi-transparent? (C#, XNA 4.0)

I've recently made some basic Blender models without transparency for a new game I've been working on, but I'm having some problems rendering them semi-transparently. Namely, I haven't been able to ...
0
votes
1answer
29 views

Graphics, drawing triangles

I'm very new to the world of Computer Graphics, and I'm struggling to find resources to help me understand how to draw my mesh (I have loaded everything into vertex and index buffers), I am not using ...
0
votes
1answer
45 views

How to force a translation to go through an exact point?

I have a camera object with a script that will whether translate it with a set speed, or stop it. I also have 7 "checkpoints", where there are 7 different quads, who will stop the camera whenever the ...
0
votes
0answers
16 views

Trying to combat jitter problem using RTE but failed,any suggestions?

I'm trying to combat jitter problem caused by lacking of precision of float when implementing tile system for planetary like earth(R ~ 6371.393km).By reading the book 3D Engine Design for Virtual ...
1
vote
1answer
52 views

Why doesn't OnCollisionStay execute continuously?

I'm currently trying to build a simple demo where the player can jump. This is the script I have setup so far. using UnityEngine; using System.Collections; public class PlayerJump : MonoBehaviour { ...
1
vote
1answer
24 views

Why do Unity networking libraries fail when building for the Windows Store?

I am using Lidgren and RSA in my networking framework, but things like IPAddress are "nonexistent" when I try building for windows store. RSA classes don't work, either. Why is this? How could I ...