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

Making ships shoot bullets

I'm programming this in C# with Windows Forms and I want to know how to make my ship go from the top to the most it could go the left then go down one row and go to the right and so on until it ...
0
votes
0answers
19 views

Calculating wheel spin for players over network

I am creating a game in unity 3d that uses google play's real time multiplayer service. The game has cars that drive around and I am trying to figure out how to apply a rotation to the opponents' cars....
0
votes
0answers
28 views

How do I turn a vector map into a nav mesh?

I have the following path finding problem: I have a map that is described as a set of polygons that are traversable and need to somehow write path finding for the system. The current data is that the ...
0
votes
0answers
37 views

The problem with the movement of the serpent (snake game)

I am a beginner,Unfortunately, the snake's movement can not write I do not understand how to do it? Do you like the idea? note:In fact, I mean, flexibility is a must have when moving in different ...
0
votes
0answers
139 views

c# adding object collision to multiple objects

I'm trying to make a mario, platformer type game, and from following a tutorial, they've done the collision like this, but im wondering if there is a simpler way to it since I want to have collision ...
0
votes
0answers
17 views

Effect of merging sprite

I want to create the effect of merging of colours if they are overlapping. My game is a tile-based game. For all intents and purposes, lets consider a tile from (0,0) to (1,1) in the entire example. ...
0
votes
0answers
22 views

Unity Compute Resource Management

I have a n open ticket with unity about some code I have that uses the GPU to generate quads and passes them to an array on the cpu. The code in question is a little specific to my situation so I don'...
0
votes
0answers
70 views

Water reflection xna

I'm actually trying to do the reflection map for my water component, but even following the riemer's tutorial about reflection map the formulas provided doens't work. http://www.riemers.net/eng/...
0
votes
0answers
87 views

How to compress an asset bundle and decompress it on iPad or iPhone

In have a prefab size of 2.4 mb, when I convert this into Unity Asset Bundle, the Asset Bundle is goes to 127.2 mb. How can I compress this into small size? My code is: public class ExportScene : ...
0
votes
0answers
80 views

Unity websocketsharp is closing the connection directly

I got a working code, which I want to change a bit for better readability but afterwards my web socket is just closing instantly. First off, I got this code working : using UnityEngine; using ...
0
votes
0answers
19 views

How can I make an expandable menu and assign names to buttons randomly from an external file using Unity?

I'd like to create a menu on the lower left side of the screen which will present some options (guns) to the player. The number of options should change based on how well a player is doing. In other ...
0
votes
0answers
86 views

How to convert a mouse's “On screen” position to “World” position C# Monogame

So the problem is this... I have a top down game, where you click on the screen to select which unit you want to control. You left click to select, and right click somewhere else to tell it where to ...
0
votes
0answers
40 views

Unity2D wall jumping not working correctly?

i've been working on this project for the past week using unity engine, its a 2d platformer similiar to super meat boy.I've been able to program jump sustain(jump higher when you press space longer), ...
0
votes
0answers
20 views

Trigonometric movement cause problem when holding player inside bounds

In my game I have a Player class. Here is what it looks like. public void Update(GameTime gameTime) { // Controls kb = Keyboard.GetState(); if (kb.IsKeyDown(Keys.W)) ...
0
votes
0answers
29 views

How to get vectices of a sprite in correct order in Unity?

Currently, when I examine sprite.vertices, I see that it is ordered in crossed way, like: one from bottom, one from up, another one from somewhere else... etc. I need the correct order to make array ...
0
votes
0answers
108 views

Save and retrieve image from database in unity

I have done a sample to insert and retrieve data from MySQL in unity.Now I need to insert and retrieve image from MYSQL in unity. The images are files selected by the user from their filesystem. Can ...
0
votes
0answers
45 views

Purple screen when using vertex shaders

Alright, so I've tried everything I can think of. I've put in over 10 hours into this crap, but nothing seems to work (tried multiple online tutorials as well). Always purple screen. Here is the ...
0
votes
0answers
38 views

LineRenderer doesn't apply material in 2D Unity5

I'm making something that draw lines with mouse on top of everything (in 2D), but the color of the line is always purple even though I assign a material to the line renderer. I could change the color ...
0
votes
0answers
24 views

Making unity inspector accept classes that inherit from a base class

I have a base class that has a lot of classes inheriting from it, I want to make a script that you can drop one of these derived classes into. How do i do that? abstract class thingy : UnityEngine....
0
votes
0answers
50 views

Rendering water with Hardware Instancing xna/MonoGame

I was wondering if rendering in XNA/MonoGame will be better using Hardware Instancing. For example, I have my editor and when I click anywhere on my map, i'll add a plane with a water texture. If I ...
0
votes
0answers
51 views

How i can make a spherical world with Cubiquity in Unity

I would like to make a spherical planet with cubiquity in Unity 5, how could I do it with a for (), so I could one cubic planet. Can anybody help me?
0
votes
0answers
67 views

Networking issue in Unity - listening port is already in use

I am trying to Network a small 2 player Unity game. This is my first go at networking, so please feel free to correct me on anything I am doing wrong. I am attempting to make a simple matchmaking ...
0
votes
0answers
64 views

Multiplayer rigidbody not receiving velocity syncvar on the client

I have a scene in which on a certain event the client spawns a prefab with the variables of position, rotation and rigidbody velocity set for it. It is working perfectly, it spawns in the right ...
0
votes
0answers
38 views

Causing a rocket engine to 'cut out' (Scale down and re scale up)

In a game im currently working on I have a fuel bar for the player. What I am currently trying to do is have the fuel bar, at around 25%, cause the player engine to cut out a little to represent the ...
0
votes
0answers
34 views

Preventing a NavMesh agent from moving Diagonally?

I'm currently working on a topdown game that uses 3D models. I am planning on using the NavMesh system in Unity to handle the movement of my NPCs, however, the NavMesh agents move diagonally when ...
0
votes
0answers
42 views

My Movement Function is working good but called only once

I have a function, It's working but not getting called every frame if It's in canMoveDown function but !canMoveDown its not. if (!canMoveDown && UpdateTilePhysics(currentBoardPiece)) like ...
0
votes
0answers
27 views

Why does Intel Graphics Monitor crash after I set a depth stencil state in my Direct3D 11 application?

I'm programming a managed Direct3D 11 application with SlimDX. I want to use Intel Graphics Monitor to capture draw calls for a single frame. When I try to set a depth stencil state my application ...
0
votes
0answers
46 views

How to create a ghost mode to replace Human character 2D platformer

I am making a 2D platformer with a character that requires a player to go through a few obstacles to reach the finish line. I want to make it so that after a few tries and obtaining a set of input ...
0
votes
0answers
145 views

Unity 5.3 Asynchronous Texture Upload in C#

I want to load textures asynchronous in C#. I heard it that it is possible to do it in Unity 5.3. However documentation doesn't mention how to do it in C#. Does anyone have an idea how it works? ...
0
votes
0answers
21 views

Removing the little box from a toggle button

Hello everyone I've this toggle button: public Texture2D togglebutton; hydro.t1Bool = GUI.Toggle (new Rect (25, 155, 100, 50), hydro.t1Bool, togglebutton); everything is fine, in my scene I added ...
0
votes
0answers
85 views

Unity3D freezes when running a project with webservices for the second time

This is a strange one and I've been trying and searching for a solution for days now. I have created a simple webservice that queries a local MYSQL database and returns the result for the client. ...
0
votes
0answers
75 views

Unity: How to create tiled sphere?

I want to build a simple random planet generator and thought of using tiles to generate the surface. I googled for hours, but I couldn't find anything helpful. At least all things I found didn't work ...
0
votes
0answers
15 views

Displaying a timer ontop of a duplicated gameobject? (Unity2D)

So I have a timer which has for example 30 seconds and when it's over it destroys my gameobject. I can make I wonder how can I take this timer and display it ontop of every one of these gameobjects? ...
0
votes
0answers
66 views

MonoGame RenderTarget2D mipmapping fades textures when zooming out

I recently ported my XNA game to MonoGame. Unfortunately, some of the textures are being faded when: They are scaled-down from 32*32 to 16*16 When the camera zooms out, the texture fades from ...
0
votes
0answers
80 views

Lock Z axis from the gyroscope rotation [UNITY 3D]

Here's the code I use. public class CameraGyro : MonoBehaviour { private float initialX; private float initialY; private float initialZ; // Use this for initialization void Start () { Input....
0
votes
0answers
71 views

Unity crash on iOS - GameObject.SendMessage()

Unity Version: 5.3.2p2 It's crashing from within Unity's internal code when doing a GameObject.SendMessage() call, it should be noted that this particular line itself is not the source of the crash (...
0
votes
0answers
39 views

Clarifications about usage of delegates, events and coroutine in a Unity script

So, the question is a bit broad, but I need to clarify my ideas about how to use proficiently such tools. Background: I am writing a simple demo that basically does what simcity does: it start a game,...
0
votes
0answers
35 views

List derived class serialization

I have an extremely simple ObservableCollection<T> implementation using [Serializable] public class ObservableCollection<T> : List<T>, INotifyPropertyChanged {...} in Unity3D with ...
0
votes
0answers
41 views

Use Same Animation To All Object Having Diffrent Position

I am new in unity. create one animation to the object and create 10 duplicates of same object. I want to apply Same animation to the all objects without starting animation at the same time and without ...
0
votes
0answers
69 views

2d Lighting over Sprites in C#

I am currently working under a project , a small application where i have to implement 2d lighting . For example , in the GDI+ canvas , a image will be drawn and i will have to put a lighting effect ...
0
votes
0answers
55 views

C# Launcher - C# Server Authentication

I know this topic is covered a ton on here, but I am having trouble getting a grasp on what tools to use in order to achieve this task. I built a simple game launcher in C# and plan to have a C# ...
0
votes
0answers
178 views

Game loop architecture using WPF(MVVM) and C#

Could i get some suggestions on how to implement a game loop whilst using WPF(MVVM) and C#, I am a professional developer and understand the technology well. The game loop usually contains a Init(), ...
0
votes
0answers
37 views

Custom bitmap font in XNA 4

Hy, brains. I'm making custom bitmap font processor and have a trouble with correct rendering. In details I have a font presented as png tile map with white characters on magenta background and I draw ...
0
votes
0answers
36 views

Animation bugging out and returning to idle state whilst moving - Unity 5

So my problem is this, my character, when moving side to side is fine and all animations play out fine. But when moving up and down he glitches back to his idle state. I have it set so that when "...
0
votes
0answers
31 views

change button text using reference to gameobject

I have a GameObject that stores a Button prefab. How can I tell the instance of the GameObject to change its text? My code below fails on the commented line below with the error: ...
0
votes
0answers
15 views

storing/retrieving values in dynamically created button script

When I click the button why is the logged text not minion 999 (which is the values I passed in bc.Setup())? When I click the button it outputs the default text of test 6 main.cs using UnityEngine; ...
0
votes
0answers
27 views

Trying to do skeletal visualization in bind pose similar to blender with octahedral mode

I already achieved drawing octahedral by just porting blender code to c#+opentk. Here ported code: static float[][] bone_octahedral_verts =new float[6][] { new []{ 0.0f, 0.0f, 0.0f}, new []{ ...
0
votes
0answers
35 views

“following” Object not Interacting with the game world correctly

So I finally have my object detecting the distance between itself and the player. If within range, the following enemy will chase the player down and touch it. (This will kill the player) However, ...
0
votes
0answers
52 views

Hide (and show) Unity window using C#

I'm making a game (in Unity3d) that features a level editor. However, the editor is made in XAML (i use WPF on Windows Desktop). In Windows Phone, the Editor is a separate application, and i use URI ...
0
votes
0answers
27 views

how to pin down a sprite partly in unity?

I am working on a simple do not let the bombs hit the floor game for android. You control a stick which can rotate to left or right depending on where on the screen you touch (left or right). But I ...