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

Monogame - tile map with XML instead of JSON

I'm working on the levels for my game so I've built these classes to read my maps: Tiles.cs: protected Texture2D texture; private Rectangle rectangle; public Rectangle Rectangle { get { ...
0
votes
0answers
47 views

How to make an object move in winform application c#?

I'm trying to make an object in such a way as to allow it to move. This is the objects that I initialized. This is a 25 cell board, made with 4 types. Black box is made from number 0, White box is ...
0
votes
0answers
16 views

Resolution-Independent Rendering squishes view field

For the last couple of days, I've been trying to get a resolution-independent renderer going on an XNA game. I have a camera and a renderer class that I added, based on this tutorial Here's the ...
0
votes
0answers
18 views

Unity 5 New Netorking, SyncVars, RPC how does it actually work

I have just started working on a client - server flow for an open world game, as far as I understand unity have implemented a fairly new ways to communicate and work with networking but I cant seem to ...
0
votes
0answers
30 views

How to silence the Windows Asterisk sound?

When pressing keys while my game is running, Windows makes the "Asterisk" or "Exclamation" sound that you hear while trying to use the keyboard on a window that doesn't have focus on an input control. ...
0
votes
0answers
15 views

Unity and C# - Lighting concentrated on floor with RenderSettings? How to get even lighting on all objects?

I am just getting into lighting with Unity 3d and right now have a function that progressively deepens the lighting of my scene here. I have done this via Render Settings and have tried 3 different ...
0
votes
0answers
21 views

How do I figure out the view space coordinates for the screen extents?

I am trying to implement clustered shading which requires bounding boxes for each view sample. In short, I'm interested in creating a single bounding box that would cover all screen space. Here is my ...
0
votes
0answers
92 views

Player character not moving

i am trying to make an fps game but my character won't move. i have tried different scripts for more than a week. Any help will be appreciated. Thanks! using UnityEngine; using System.Collections; ...
0
votes
0answers
23 views

Load a specific sprite by name from a SpriteSheet with Resources.Load

The question is in the title. i want to avoid loading all the sprites from a sprite sheet into a dictionary for example so I can assign them that way. Is there a way to access the specific sprite ...
0
votes
0answers
28 views

How to prevent object from moving when it's mesh/collider is being updated?

So I a made a script that lets the player grab a vertex, move it, and then update the mesh. To help prevent the player from trying to clip it through other objects I made it so the mesh/collider is ...
0
votes
0answers
38 views

Unity 3D - Tags not Working

I have triggers that interact with planes, each individual plane has a specific tag. The problem is, that it seems to just detect all planes but one called "Middle Plane" Here is the link of the ...
0
votes
0answers
31 views

Setting a destination to Nav mesh agent but the character moves around the edges of the walkable area

I created a character. Added character controller, rigidbody and nav mesh agent. On right click I get the position clicked using raycasting and set the hit point as the destination for nav mesh agent....
0
votes
0answers
22 views

SharpDX.SharpDXException error when using vector as parameter

I placed a GraphicsDevice and width/height into the new RenderTarget2D parameters as it ask for but it keeps throwing an error. Does any one know why? Error: Additional information: HRESULT: [...
0
votes
0answers
26 views

Unity3D c# get animation playback position AFTER it is stopped

As title says, i'm having trouble determining playback position of legacy animation after it has normally finished playing or has been stopped. Here is a oversimplified demonstration: //how i get ...
0
votes
0answers
22 views

Script for Sprite Slicing works fine as a MonoBehaviour, but not as a normal class called in a Editor Script

I got a script for auto-slicing sprites from the internet. Link to the script. I made the script so that it is not a MonoBehaviour. Then i do this is my custom assets importer: private void ...
0
votes
0answers
49 views

Unity Android character controll with UI Buttons

So I'm trying to find a good tutorial which will explain how to controll character in 2D game when button is clicked (left, right, jump button). All the tutorials I've found are outdated and not ...
0
votes
0answers
39 views

Animation is slow on iOS Device and fast in Unity editor?

I had made a Settings popup in the game and animated it like scale animation (from 0 to 1) values. It is appearing very smooth and works good in the unity Editor, but after building to the device it ...
0
votes
0answers
46 views

XNA Access violation from KernelSoundEffectInstance

Some users (but not all) are reporting a periodic crash in my XNA game. They say it's happening every 15 to 20 minutes. I am unable to replicate this myself, so I asked users to send me error logs. ...
0
votes
0answers
12 views

HOw to load all “ *.extension ” file from specific folder in unity.?

I want to load my all file from folder of "* .dat" or ".txt files in list one by one. And If you can help then also tell me to make them all clickable with different event respectively.
0
votes
0answers
33 views

Defining camera/view space

Im working on expanding my camera class, but having trouble defining camera/view space in the manner of this diagram: What Im trying to achieve is to define the camera as a true object much like a ...
0
votes
0answers
167 views

Unity UI Drag and Drop with conditionals

I have a nice UI drag and drop system (big thanks to quill18 and BoredMormon for their tutorials) and want to get some conditionals in it. I have 4 numbers (that are instantiated on the canvas) that I ...
0
votes
0answers
50 views

Using the perlin noise of unity efficiently?

I have a little problem with my perlin noise values. It is generating a voxel mesh, that is flat. Here is a picture that demonstrates what I mean: As you can see, the terrain lacks any ...
0
votes
0answers
25 views

Clip on model XNA

I'm currently doing my water plane system (with waves etc...). Actually, I have a heightmap with a waterplane on it; refraction and reflection working perfectly, but now I want to add objects. So ...
0
votes
0answers
64 views

Side-Collision for Breakout game where ball moves fast

So I've been trying to make a breakout clone, which is my first attempt at a graphical game, I ran into some problems, and was hoping that this community could help me. I've got most of the mechanics ...
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
20 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
32 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
191 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
25 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
76 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
95 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
92 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
21 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
98 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
33 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
136 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
46 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
43 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
35 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
54 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
54 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
72 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
74 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
39 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
40 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
43 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 ...