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

1
vote
1answer
44 views

Global variables in a multiplayer environment

I would like to know what's the best approach to solve this problem. In a racing game, i need to create the final result chart. In a single environment i've tought something like: private string [] ...
0
votes
0answers
9 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 ...
2
votes
1answer
224 views

Problems with Raycasting Requirements

Im working on a script which kinda works like an Enemy AI. Its kinda like a detection system with requirements that are required to be met. This is a recent question i asked using my code Raycast ...
0
votes
2answers
28 views

Lerp velocity in specific time

How to lerp velocity to 0 in specific time? For example in two seconds? I need this for jumping. velocity.Y = MathHelper.Lerp(velocity.Y, 0, [time]);
0
votes
0answers
12 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 ...
2
votes
2answers
24 views

In Unity, is there a way to Set a new MeshRenderer?

Here is what I want to do in Unity for a given GameObject go = new GameObject(). I want to create a MeshRenderer, change its properties and only in the end set it as the component of go. For instance: ...
0
votes
1answer
42 views

Access to varibles in other attached gameobject script is ambiguous

I'm trying to create reusable scripts that I can drop on my GameObjects. I am currently trying to figure out how to build a projectile script. Ideally, I want to be able drop this scrip on an enemy, ...
1
vote
1answer
281 views

Collision detection doesn't register until player sprite jumps

I have implemented a shooting mechanic into my game, and the act of shooting works fine. The shooting work is done in my "game1" class. The issue that arises is when I incorporate collision detection ...
1
vote
1answer
88 views

Can't call GameCenter in my Unity game for iOS

I'm trying to integrate Game Center into my Unity 5 project and facings troubles. It seems that authentification is OK when the game starts on iOS device, a notification appears, but leaderboard ...
0
votes
1answer
57 views

How to “print” sprites on a 2D canvas (UNITY5 - C#)

I wanna show a minimap on the screen, but I don't have any idea to how to paint something in a panel on a canvas by code. I've tried instantiating a prefab image but didn't get to work. Any ideas? I ...
0
votes
0answers
25 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
1answer
85 views

Calculating unique ID number from a set of bitmasked tiles

So I write this kind of match3-style game where you as a player need to match tiles with three or more of the same type and I'm thinking what is the best method to recognize the shapes without writing ...
0
votes
1answer
39 views

Assign a ScriptableObject to MonoScript through code

Sample code: public class Item : MonoBehavior { public ItemObject item; //the scriptable object void Start(){ // do stuff} } Normally I would drag and drop the asset of the ...
0
votes
1answer
37 views

Unity 3D - create autonomous moving robot in house + first person camera movement

I have very, very little knowledge about programming or Unity. I have done some basic tutorials, but I want to try something harder. The thing is, I don't know where to start. If you find the time to ...
0
votes
2answers
112 views

Detect Input.GetMouseButtonUp outside a GameObject in Unity?

How do I detect Input.GetMouseButtonUp outside a specific GameObject's area in Unity? Are there any Unity Assets for this?
0
votes
0answers
9 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
1answer
59 views

How to combat exponential growth in sprite messaging?

In my 2D platformer game, I have a number of sprites moving around the world. When two sprites collide with each other, I calculate how deep the collision is and then call a virtual method on both ...
4
votes
1answer
112 views

How do I change a value gradually over time?

I'm using Unity3D 5-point-something, and I'm planning on making a game where the player travels through a hot, dry desert, and so the heat causes the player's energy to deplete. The object of the ...
4
votes
4answers
3k views

Does “Object.ToString().GetHashCode()” return a truly unique character seed?

In my game I'm generating a character seed from a bunch of traits that the player chooses. The traits are all part of a Enum. In unity I've attached a script to a bunch of toggles. When the player ...
1
vote
1answer
422 views

Image target display in unity Vuforia

I am using unity 4.5.1f3 and using the Vuforia sdk 5.0.5.I have downloaded the sample project from the Vuforia site.When I tried to run the sample of Imagetarget project,it asked to add license ...
0
votes
1answer
91 views

Uncontrollable platform spawning

I made simple spawner like this: void Update() { if (PlatformPosition.spawnNewPlatform) { NewPlatform(); } } public void NewPlatform() { if (active) { newTransform = ...
0
votes
2answers
65 views

C# XNA :Snake Game, direction problem

I am trying to do a snake game in XNA but I have some little problems... I explain : The Snake has a direction (Enum Type : Haut(=up), Bas(=down), Droite(=right), Gauche(=left)) When the player ...
1
vote
2answers
58 views

How do I implement level generation based on graph grammars?

I'm looking to do some pseudo-random map generation using graph grammars (graph rewriting). However, most of what I can find online on this is purely academic and, while helpful, doesn't have any ...
3
votes
2answers
561 views

Preventing a Combination of Rigidbody Jump Force & Bounce Magnitude in Unity3D

I'm building a fairly simple marble racing game in Unity3D. The ball is a 3D physics object that moves only on the X and Y axes. It has the ability to roll left and right, and to jump. Pretty basic ...
0
votes
1answer
47 views

Top Down Bullets will not move

I have a top down shooter. The player can move in the primary 4 directions, and follows the mouse for rotation. When I shoot, the bullets never leave the player, they just spawn on top of the player ...
0
votes
1answer
37 views

Quickly Converting RenderTexture to Texture2D in Unity3D

I have a screenshot preview at the end of the game's level. When I am loading the screenshot, it makes the game freeze for a moment. What may I do so there would be no freeze when I am loading that ...
0
votes
0answers
17 views

Stack, list or array for screen/state management. (XNA/MonoGame) [on hold]

I am wondering the best approach to manage game state in monogame. My first thought is have a screen class and keep them in a collection with either isFocused properties or use like a stack and the ...
1
vote
2answers
76 views

Get the difference between 2 matrices

Hi I'm using C# and MonoGame, and have the world matrices of 2 objects. I need to get the difference between them, so I can effectively parent the second object onto the first. The aim is to get to a ...
1
vote
1answer
90 views

XNA4\ Monogame 3d Collision detection Help please

i have been trying to get 3d collision working for a while and i think(hope) you people can help me so for my project i have created a 'sprite3d' kinda class which is called ModelEntity and there ...
-4
votes
0answers
50 views

How to develop website like zengaming [on hold]

Can anybody suggest me, what are the Major technical Issues and how to resolve it for developing the application like - Zengaming.co Some of the problem I have faced - Created the csgo dedicated ...
1
vote
2answers
158 views

Determine facing direction mecanim 2d movement

I'm using this script to move my character in my 2d world: public float speed; //Movementspeed public Rigidbody2D rbody; Animator anim; void Start () { rbody = ...
1
vote
1answer
38 views

How to check strings from multiple lines in one input field?

I need help with input fields. I already set the line type to 'Multi_Line NewLine' in inspector, but I have problem with submitting the string. Here's the code: using UnityEngine; using ...
3
votes
1answer
218 views

Local avoidance together with any-angle types of A* Pathfinding

Recently I have been implementing the Block A* any-angle path-finding algorithm in a project I have, for which I need extremely efficient results due to the large number of NPCs. However, I still do ...
0
votes
1answer
61 views

Recognizing runes drawn by user

I want to implement a system where the player can draw runes on the screen with multiple gestures. Meaning its not just one motion it can be up to 3. So far I have implemented the $P Recognizer . In ...
1
vote
2answers
1k views

Unity2D: Automatic scaling of camera and sprites

I'm working on a point-and-click adventure game using Unity2D for mobile devices and possible PCs and I'm trying to wrap my head around supporting devices with different screen sizes and aspect ...
0
votes
3answers
46 views

Problem with handling key input C#

I am attempting to make a game in C# in windows forms, and need for the character to react to key input. I have implemented a very basic code which changes the position of a picture box on key ...
-1
votes
0answers
52 views

How to listen and take action on Steam CSGO dedicated server live state [on hold]

I have setup a CSGO dedicated server on win7. This game is visible on player machine in Internet tab and also they are able to play it. As the player plays game, the stat, and logs are continuously ...
1
vote
1answer
28 views

Making Basic Touch Behaviors

I am trying to make Basic Touch behaviors for my game where i want to Pan Camera by Single finger touch. Zoom Camera by pinch With two fingers ofCourse. Rotate Camera by two fingers rotation. Rotate ...
1
vote
1answer
65 views

How to rotate camera counterclockwise around player?

Holder contains camera and rotates around player Camera looks like in diablo, titan quest, grim dawn, etc I cant rotate camera to negative angle values My code: public void ChangeRotation(float ...
0
votes
0answers
28 views

Windows 10 UWP Game development [closed]

I intend to create a simple 2D game for entire suit of Windows platform (UWP). I haven't used any game development engine or otherwise before. The game would basically have a simple physics engine, ...
0
votes
0answers
19 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 ...
2
votes
2answers
142 views

Touch taps only on very short flicks on Win7 with Monogame

I have an application on win7 which needs to support touch and mouse input using monogame. But reading touch taps proves to be a very hard thing. The TouchPanel is initialized like this: ...
0
votes
0answers
74 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
1answer
29 views

Make a person walk faster when standing on plane/panel in Unity?

Is it possible to make a person walk faster when standing on plane/panel in Unity without writing a lot of code? If so how? I am using the standard asset first person movement prefab.
-3
votes
2answers
254 views

Random AI Movement

So I'm creating a zombie game where the zombies are passive and just walk randomly all over the area when player is not near. My question is: how would I make zombies move randomly? I code in C#. ...
3
votes
0answers
18 views

Automatic audio segmentation and find the most energetic segments

What algorithm can be used for audio segmentation? I want to divide song to segments and find the most energetic segments (begin and end in seconds). It is needed for the rhythm-game. Examples: ...
1
vote
1answer
80 views

Problem disposing content from a screen's content manager

I have a problem with my game. I am using multiple classes for different screens, for exemple: Main Menu is one screen, When playing is another, and so on... I decided to use multiple ...
0
votes
3answers
273 views

How to access multiple 2DTexture which is assigned in Unity3D inspector panel created by an array in C#?

I am making a puzzle game, i made 5X5 cube, lets take example of orange. very left column is orange, upper with orange dot is static and lower with orange dot is also static. inbetween there are 3 ...
1
vote
1answer
326 views

Questions about scaling in a 2d game in unity

Okay, so: I am making an android game. I want everything to scale to the size of the screen I'm using. Further, my static background needs to scale (as well as every other object), but if the aspect ...
3
votes
1answer
31 views

How can I add a new item to my enum list in the inspector?

I have a list of enums. I want to add a new item to it without scripting to make them more easily modifiable for game designers. I made an inventory system and I want to define the type of an item. ...