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

How to send data from Unity to Mailchimp

I have followed the WWWForm script reference to try to connect Unity with Mailchimp. According with the log, the form is sent without errors. Unfortunately Mailchimp did not stored any data. This is ...
1
vote
0answers
131 views

Is it a good idea to use the RDM socket type for multiplayer games?

I am currently developing a MOBA/RTS style game with an authoritative networking structure. Of course, the server needs to send a big number of packets every second, answering requests from the ...
0
votes
1answer
154 views

How can I adjust steer angle based on speed in Unity?

I'm following this (https://www.youtube.com/watch?v=kAEpLX3rfms) video on how to make a car in Unity. But my car doesn't lower the steering angle based on the speed of the video. The idea was that you ...
1
vote
2answers
645 views

Unity set ui image as active onclick

I want my button to activate an inactive ui image in the hierarchy through c# called "Responded_A" when the "Response_A" button is clicked. I assume this will use setActive in someway, but I'm just ...
3
votes
1answer
236 views

How to implement visibility graph pathfinding in Unity/C# to detect paths (i.e. visibility connections) efficiently?

I am struggling with implementing continuous path-finding trough visibility graphs. Notice, I know that grids can be used even when movement is not trough grids (e.g. Theta*). But for my current needs,...
4
votes
0answers
206 views

smoothly recenter view over time

I'm currently using the Google Cardboard SDK for Unity to build a fighter pilot simulator. What I'm currently trying to do is recenter the view(CardboardHead) smoothly over time when the user looks ...
3
votes
1answer
239 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
2answers
202 views

Fixing enemy behavior state machine in Unity

I'm working on a state machine for my game's NPC. The only thing I can't to get work properly is the hit sequence. The hits register. What I would like to happen is for the attack sequence (animation)...
1
vote
1answer
57 views

Per pixel collision for scaled textures in Monogame Windows Phone 8

I have some serious trouble with pixel-collision in my game. I am using the Matrix Scale parameter in Spritebatch.Begin method, to scale the content for each device's resolution correctly. ...
0
votes
1answer
53 views

In unity, how do I rotate a vector in relation to the player?

I am making a radar script in a unity FPS game project I am making for class. I already have a working example of a radar script that works in relation to the player's position. However the rotation ...
2
votes
1answer
160 views

Using XBox 360 controller in Unity game - game doesn't recognize axis movement

I have a problem with the usage of XBox controller in Unity game. I connected the controller to the PC and it works fine, I also managed to use it in the game itself - I'm using "A" button to fire and ...
0
votes
1answer
82 views

Can I use sin or cos for the non uniform rotation in unity 5? [closed]

I have few objects which I have to rotate on an ellipsoidal track and speed is changeable at the run time because its a betting game in which racing will be done so speed values will come from the ...
0
votes
1answer
63 views

Collision Detection in Wander behaviour

briefly, this is the overall look and feel of my game: I have a player and I have an enemy in my map. i tried to learn collision from SaladRaider Youtube channel. collision using chasing method works ...
0
votes
3answers
81 views

WaitForSeconds isn't working

I have a class which is changing the player speed. Here is the code: using UnityEngine; using System.Collections; public class MultiplySpeed : MonoBehaviour { public int multiplier = 2; ...
1
vote
2answers
162 views

Syncing items between server and client

I'm doing this game of mine, and I want to add the items to it. I'm already familiar with the basic concept of syncing data between server and client, Usually using sync state, that's what i've done ...
-2
votes
1answer
510 views

the object of type 'GameObject' has been destroyed but you are still trying to acess it [closed]

the object of type 'GameObject' has been destroyed but you are still trying to access it .your script should either check if it is null or you should not destroy the object my script is in c# w =...
4
votes
1answer
99 views

Creating three-dimensional biomes

I have an idea for a space-based game where there are different sectors of control. These would be set up in a manner similar to terrain biomes, where there will be clusters with limited space between ...
0
votes
0answers
73 views

How do I use Bezier Curves in unity?

I have to rotate few objects on an ellepsoidal(Capsule shaped) track and at the run time speeds are assigned to the objects from the server as this is a betting game which I am developing in Unity 5 ...
1
vote
2answers
410 views

Textures rendering upside down and small with Pixel Shader in Mono Game but not XNA

I'm new to HLSL, attempting to use MonoGame to do some simple post processing effects. Here is my HLSL file, taken from one of rbwhitaker's xna tutorials (I would post the link, but can't post more ...
0
votes
2answers
3k views

How to detect mouse over for UI image in Unity 5?

I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
3
votes
2answers
967 views

MonoGame 3.4 Content Pipeline Extension missing reference

I'm pretty new to MonoGame and XNA in general. So was wondering how I could import custom content and make it work on any platform. So I came across Content Pipeline Extensions wanted to do it like ...
1
vote
1answer
291 views

Snake game tail

I am working at a 2D Snake Game in Unity. This is the head of the Snake: http://i.imgur.com/RrKr9cg.png And this is the Extension of the tail of the snake. It is added everytime I eat something: http:/...
0
votes
3answers
165 views

Game Slowed by Particles in XNA

I am developing an XNA game and am trying to improve the performance of the game by hiding objects that are not visible to the user. My first thought was to use a BoundingFrustum based on the camera'...
0
votes
0answers
68 views

State Machine help

I'm using a state machine for my enemy's AI. I've not worked with state machines before & followed Unity's live training on State Machines. I added a HitState to handle animation sequences. The ...
1
vote
1answer
428 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 key....
0
votes
0answers
85 views

How do I rotate an object on iTween path on a curved track in Unity 5?

I have 10 objects which I have to make run on an ellipsoidal track for which I am using iTween PutOnPath. The objects are running on the track but as the curved track comes the objects do not rotate ...
1
vote
0answers
110 views

Bold black bar on right side of game in Unity (Android)

I am trying to create an endless runner. I have already created a system to generate infinite backgrounds from an array of some. However, on running the game, I get huge black bar on the right side of ...
2
votes
2answers
853 views

How to achieve lighting like this in Unity for 2D games?

How could I accomplish a lighting effect something similar to this game?: I'm not talking about the shadows but about the glowing/lighting effect on the crystals and the torches. Anyone got any ...
1
vote
1answer
270 views

Monogame - Screen transition with fading

I'm trying to create a fade logic with Monogame for my screen transitions. I've read tutorials online but I'd like to work with Premultiplied Alpha for the fading. I've seen people add 1x1 pixels ...
0
votes
2answers
3k views

Press button event instead of onClick() in Unity

I want to add a nitro in my arcade game and i want to detect press UI button instead of click. unfortunately only onClick() event is available for UI button what kind of options do I have ? Thank ...
16
votes
2answers
2k views

How to design context menus based on whatever the object is?

I'm looking for a solution for a "Right Click Options" behaviour. Basically any and every item in a game, when right clicked, can display a set of options based on whatever the object is. Right ...
6
votes
3answers
961 views

How do I accept only one directional input per update?

I'm coding "Snake" as my first game and I'm facing the logical fail when pressing multiple keys simultaneously eg. { up, right}; {up, left}; {down, right}, etc. Snake is able to go back and forth and ...
2
votes
1answer
286 views

Modularization in a project

I'm writing a C# game in Mono, and I want the game to be as modular as possible. I've started by writing the whole Item (inventory) System of the game in a seperate .dll library But I've hit a problem....
0
votes
2answers
1k views

How to change alpha of a sprite through script in Unity

I have 4 buttons and they each flash when the button is pressed. However if you were to press a button, then while the button is darker (flashing) click another one, that button then stays dark. I ...
0
votes
2answers
43 views

Transparency temporarily lost from a rendertarget when drawn to for one frame

I have a transparent RenderTarget2D that I draw every frame. Before the first frame is drawn to the screen, an image is drawn to the render target. The image also contains some transparent pixels. ...
1
vote
1answer
724 views

Unity Texture2D raw data TextureFormat problem

I am trying to load raw image data into a Texture2D in Unity using LoadRawTextureData but I can't get it to work correctly. First I receive an array of bytes from an unmanaged function that captures ...
0
votes
0answers
65 views

How to change the Gameobject on a button click

Suppose I have a three gameobject(g1,g2,g3,g4,g5) and I have two button Next and previous.Suppose when i click on next button from g1 the object should move to g2,when i click on next button again it ...
0
votes
1answer
992 views

Unity3D - override main camera rendering for compositing effect

I'm fairly new to Unity and am having a bit of trouble understanding the rendering pipeline. I need to render the scene to four "windows," so that the viewport shows a 2x2 grid of the scene, each ...
1
vote
1answer
124 views

Unity Collision Doesn't Work when Two Players Instantiated

I am using Unity3D and I have a problem. I have a script which instantiates the player gameobject once you are connected to the server. I also have an attack script. When there is only 1 player on, ...
0
votes
1answer
110 views

An Object is moving but its velocity is 0

In Unity 5 I have an object move when I press a button, force is added as seen by the code below. Then once this force is added I print out its velocity. The problem is that in the console my first ...
2
votes
1answer
124 views

Given a 3d goal point and a turn rate in radius, find max speed to reach goal

I'm working on a 3d space sim with AI agents flying ships through space. I am trying to get them to follow a waypoint path nicely, which involves figuring out how fast they can be travelling and still ...
1
vote
0answers
76 views

Unity 5 Distributed Physics in Client Server Model

I have a server which controls a physics object via buttons, adding force whenever I click them. I want to be able to have a client connect and whenever the physics object has a reaction on the server,...
0
votes
2answers
58 views

Limit the boundary of Touch

a game that I currently working on is in a way that player should actually draw a rainbow on the screen by tap and drag gesture in order to make a hills for the car. but the issue that i currently ...
0
votes
1answer
369 views

Unity - SetActive() on GameObject dont works on child's objects

I have the following line of code: GameObject.Find("_obstacles").SetActive(false); It serves to leave an inactive object, but the children of this object are not getting with the same status. My ...
0
votes
0answers
41 views

Is there a way to apply euphoria physics (ragdoll) to rigged Sprites in Unity2D?

With euphoria physics I mean the realistic object interaction and freefall as seen in most games like recent GTAs. But I want to do that in 2D. (I am a beginner :P).
0
votes
1answer
232 views

Generating objects randomly from prefabs in Unity2D

I am developing an infinite runner using Unity. I have already figured out how to loop a set of backgrounds randomly but I am having problems doing the same for the objects. So, I have a few objects ...
0
votes
0answers
43 views

Evaluating ratings to balance weapons

I am developing a text-based battle arena RPG on the web. I'm at the part of development where I need to come up with weapons, and I want them to be balanced, yet I have no idea how to make a formula ...
0
votes
1answer
107 views

How to configure A* for large 2D Grid based pathfinding, where paths could be long or short?

I thought A* was Optimal, meaning I'd always get the quickest path. I have written a generic Pathfinding implementation here: https://github.com/mGuv/mGuv/blob/PathPerformanceExperiment/mGuv/mGuv/...
1
vote
1answer
125 views

How do I know what button was clicked? (Unity)

I have a prefabbed button (UI.Button) which I'm instantiating ten times: public void LayoutButtons() { GameObject newCanvas = Instantiate (canvas) as GameObject; for (int i = 0; i < 10; ...
-1
votes
1answer
27 views

C# Refence or instance ( For List and assignment ) [closed]

First question : Does List holds the refence to an object or the instance itself ? Second question : When I assign an object to another, are they the same instance or two different ones ? ...