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

how to set only one collider with OnCollisionEnter(Collision col)

I tried with this: void OnCollisionEnter(Collision col) { Debug.Log("hit everything"); if (col.gameObject.layer != LayerMask.NameToLayer("bico")) { if (col.gameObject.tag == ...
0
votes
1answer
27 views

Increment int in array - int i is out of scope?

This is my scenario: I have a 3D model of a house, and an autonomously moving robot moving through the house picking up multiple objects. I have an array of 3 objects I want it to pick up, but I ...
0
votes
2answers
28 views

What Collider should I use for my Player object?

I am making a 3rd person game with a simple orbit cam and it works fine most of the time, but since I have a box collider and I walk across an uneven surface, the player tends to tip over. How should ...
0
votes
1answer
24 views

Moving autonomous robot form one location to another based on array

I have a 3D model of a house, and I want an autonomous robot to move from 1 object in this house to the next one. I have it moving to the first, but it won't move to the second one. This is my code: ...
0
votes
2answers
27 views

Is There a Way To Keep Precision When Transforming GameObjects

I've seen this issue before, but it's never been a particular issue for me until today. I have each "room" of a dungeon created with a class script that contains details of that room. During the ...
0
votes
2answers
27 views

Autonomous robot - moving from 1 object to the next object

This question falls in line with my last question: Unity 3D - create autonomous moving robot in house + first person camera movement What I have I have a 3D model of a house; a first-person camera ...
0
votes
1answer
8 views

Drag event inverts in landscape mode

I am developing an car game for android with an UI steering wheel to control the car. I'm following Answer example for the wheel rotation. This is the code to rotate the wheel. ...
0
votes
0answers
17 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
1answer
13 views

Type `UnityEngine.UI.Text' does not contain a definition for `Text'

I came from Unreal Engine 4. I created a script, and I keep getting an error: Assets/scripts/UpgradeManager.cs(17,18): error CS1061: Type `UnityEngine.UI.Text' does not contain a definition for ...
0
votes
0answers
12 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
14 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
2answers
29 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]);
2
votes
2answers
29 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
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
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
48 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
1answer
60 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 ...
0
votes
1answer
44 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
0answers
18 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 ...
0
votes
2answers
66 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 ...
-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 ...
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 ...
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 ...
1
vote
2answers
77 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
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 ...
-1
votes
0answers
52 views

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

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 ...
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
vote
1answer
29 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 ...
0
votes
0answers
29 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 ...
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 ...
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
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: ...
0
votes
0answers
75 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
1answer
32 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. ...
5
votes
1answer
116 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 ...
0
votes
1answer
27 views

Creating 3D gravity in zero-G tied to mass in unity with c#

As a total beginner, I've been working on a patch-job script for a gravity mechanic in an open space sim, I want to derive all my objects from this "Block ALPHA" object and its' set of variable ...
3
votes
1answer
51 views

Ability/Skill Data and Method Structure (C#, Unity3D)

So I've come to design my game which players will be having a unique set of skill or ability to come with. I can store skill name, mana cost, cooldown, etc in database which each skill have in common, ...
0
votes
1answer
34 views

How to remove terrain in 3d? [duplicate]

After the release of Minecraft I saw more and more rip offs of the game but some actually began to change it up a bit making the game have a organic look instead of the iconic blocky one that ...
1
vote
1answer
37 views

How do I make my indices anti-clockwise, so I can cull triangles in OpenGL? (immediate mode)

At the moment, I'm attempting a basic game engine in OpenGL using immediate mode. I'm trying to render a cube. Cube is a class with the vertices, normals, and indices. Here is part of the Cube class: ...
0
votes
1answer
51 views

How do I know what to do with incoming network messages?

I am programming a 2D game in a server/client architecture with C# and lidgren. When a client sends a message to the server, how does the server know what to do with that message data? The client ...
-1
votes
1answer
36 views

Moving object orientation toward its movement in unity3d [duplicate]

I have a gameObject (camera) which is moving on the spline. I want to set it orientation towards it movement. Means, object should need to see where it is moving. I some thing tried this but this is ...
0
votes
0answers
16 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
1answer
55 views

Problem with Quaternions and Unity's Euler Angle Convention

So I want to rotate an UI-Element according to my magneticHeading, I just want to apply the magnetic heading to the z rotation in EulerAngles. So I tried to do so, which brought me to some weird ...
0
votes
1answer
20 views

Coroutine wrong Behavior when scene is loaded.

Ok so I have this coroutine : IEnumerator ShowCharTraits() { while(!hasPlayerChosen) { yield return null; traitPanel.SetActive(true); } ...
0
votes
2answers
40 views

My background stopped looping and is mushy and weird looking

My looping bacground texture looped perfectly, but maybe after building the project as an android project broke it? How can I fix it? using UnityEngine; using System.Collections; public class ...
0
votes
3answers
96 views

How to spawn enemies within a minimum distance of each other randomly? 2D

So I'm making an 2D infinite runner. So I try to spawn obstacles randomly in x-coordinate, but these just spawn most of the time in the same position and too frequently. generationPoint is just a ...
0
votes
1answer
34 views

LookAt different object smoothly in unity3d

As picture depicted my camera moving on path i want to lookAt bath different object smoothly. Currently have tried trasnform.LooAt(activePath.gameObject.transform); but it producing jerky result. ...
0
votes
0answers
21 views

Alternative to LookAt in unity3d [duplicate]

How does unity LookAt work i searched and found that this is how lookAt work but seems that it is not right? Vector3 lookPos = transform.position - ...