C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
0
votes
0answers
3 views
Rendering tmx maps with Monogame and TiledSharp
I'm having trouble to render the tmx map on monogame. I'm using TiledSharp that just import the map, and I have to render it myself. When I render the map, it is rendering a few tiles, others not.
...
0
votes
0answers
8 views
Content Manager VS Resource Manager VS Asset Manager [on hold]
When creating a class that will handle the game contents/resources/assets and using the MonoGame framework, which is the best to use as a name for the class and why? Is it the ContentManager.cs, ...
0
votes
1answer
16 views
Ray & Segment Intersection
I'm writing some code to check intersection between all of a rectangles segments and a ray. It will sometimes use the Left and Right side of the rectangle as the closest face hit (face DA & BC) ...
0
votes
0answers
7 views
Unity FP Character Can't Look Vertically
I have a FP Character and well, it can't look vertically. Its happened about 3 times now, each time I just replaced it with the standard assets prefab, first few times it worked fine, but then after a ...
0
votes
1answer
28 views
Unity 5 C# - onClick.AddListener in a foreach loop using lambda expressions
I'm trying to dynamically create Unity 5 UI buttons that each set a global variable decision_id to a different value when clicked.
The problem I'm having with this implementation is that they all ...
0
votes
0answers
28 views
Colliding without physics in Unity: is it possible to put OnTriggerEnter in the moving character?
My main question is: is it possible to put OnTriggerEnter in a script that goes attached to the moving character instead of to trigger area/object? Let me explain my exact need.
I want to detect the ...
1
vote
1answer
32 views
Transform.LookAt rotates the sprite and collision not triggering
I've applied the below script to a gun object to instantiate bullets to the direction of the mouse position.
The bullet collision is not getting triggered since the bullet has been rotated.
How to ...
0
votes
1answer
30 views
Fixing strange artifacts in an HQX shader
I'm having an issue implementing an HQX filter that I found in the LibRetro GitHub repository.
LUT texture was obtained here
Shader file was obtained here (I converted it to compile in MonoGame with ...
0
votes
0answers
38 views
Selecting Dictionary item based on custom classes instead of keys
I am attempting to write my own path finding code for a game I'm working on that will implement a form of the A* algorithm. I store my nodes of the path finding system as a class called nodes and add ...
2
votes
0answers
82 views
How do I create a draggable object which snaps to obstacles in the way?
I bring yet-another-drag-with-mouse question (I am using Unity with C#), but with a less common particular detail: the existence of obstacles in the middle of the way trough which dragging occurs (3D ...
0
votes
1answer
33 views
Find x and y position with angles in 3D world
I'm actually creating a Tracking Camera (or 3rd person camera), and to do so, I used two angles (X and Y) for the rotation of the camera and an other floating value for the distance between the target ...
2
votes
1answer
28 views
Assigning Objects when duplicated in the editor?
I'm wondering if there is a way to have an Object when duplicated in the editor assign a GameObject variable to the newly duplicated version of itself. Is there an option in Unity or do I have to code ...
0
votes
1answer
33 views
Monogame spritebatch not drawing to screen [on hold]
I created a seperate class to draw a sprite.
namespace Game7
{
public class durtle : Microsoft.Xna.Framework.DrawableGameComponent
{
SpriteBatch spriteBatch;
Texture2D durtlesprite;
...
1
vote
3answers
47 views
Unity C# - Raycasts, How to Ignore Triggers?
Let's say I have a Raycast, but I don't want it to collide with any triggers. I don't want to change the Project settings since that's a little inflexible.
How can I have a Raycast ignore any ...
1
vote
3answers
78 views
What's the most efficient way to find the position of a point in relation to corners of a rectangle despite rectangle's scale
I am struggling to achieve the following with C# (in Unity). I need to find the position of the points that lay at a given distance (let's say 1m) from the corners of a rectangle, in a way that the ...
0
votes
0answers
28 views
Best practices for client-server communication in an online Android game
I'm developing an online RPG game for my "Object-Oriented Programming" module laboratory project. The client part must be written in C#, also using Unity 3D as a graphics engine.
The problem is that ...
0
votes
0answers
11 views
Unity 3D - Changing emission color in realtime after export doesn't work
I am using the following code to change material's emission color in realtime:
Color selectionColor = new Color(0.3f, 0.2f, 0.0f);
void Start()
{
...
2
votes
3answers
72 views
How can I detect if a gameObject has collided with two other specific objects at the same time?
How can I detect if a gameObject has collided with two other specific objects AT THE SAME TIME?
This is what I intend to do but it does not work:
void OnCollisionEnter (Collision col)
{
...
0
votes
0answers
6 views
First person view camera control using joystick in Unity3D
Can anyone give me any tutorial about how to program a first person camera control using joystick in unity3d? I've been searching for this for a long time and I'm out of depth unfortunately. I only ...
0
votes
1answer
18 views
Monogame shader not working
I'm trying to use this this tutorial in monogame, but the effect does not work, only renders a black screen. Everyhing by itself renders just fine, I looked at the render targets if they get drawn to, ...
1
vote
3answers
53 views
Camera follows player but how to stop camera moving when player moves
The player is moving automatically diagonally down the screen, and I have the camera as a child on the player. I would like the camera to always be following the player (who sometimes slows down / ...
0
votes
0answers
19 views
Array index within bounds inside Start(), but out of bounds elsewhere [closed]
I want to access specific elements of an array via a button click.
But I keep getting this error:
IndexOutOfRangeException: Array index is out of range.
ArrayAccess.GetArrayElement () (at ...
0
votes
1answer
41 views
Most efficient way for nested loop to not repeat a value of parent loop in pair-wise structure (C# or Javascript)
It's hard to choose the correct title for this question, so let's see if I am able to better convey here what I am in search for. If the title is too far away, suggestions are welcome and I can edit ...
0
votes
4answers
135 views
Is database necessary?
Hi I have studied c# for good few months and I'm at intermediate level at the moment.
And few days ago I decided to make simple 2D Games like "Mr Jump" after studying Unity.
So my question is as ...
0
votes
0answers
46 views
Unity 5 2d array for storing game objects and their data
I want to have a 2D array which has a number of rows relating to the number of game objects and 3 columns. I want each row to have the name of the game object and its position and velocity. Is this ...
0
votes
0answers
45 views
Unity C# event handler not triggered
I am trying out a system in my game in which I have 3 classes:
EventService: MonoBehavior
EventStore (a normal c# class)
EventViewController: MonoBehavior
EventStore registers some callbacks to ...
1
vote
1answer
38 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 ...
0
votes
0answers
26 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
31 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
33 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 ...
0
votes
1answer
42 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 ...
1
vote
0answers
25 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 ...
-2
votes
1answer
65 views
Unity2D - How do they make those smooth and nice animations and mechanics inbetween the game? [on hold]
Take Angry Birds 2 for instance. It's been developed in Unity. If you play it, you get to see how alive that game is. It has so many events going on.
My basic concern is that how do they make those ...
0
votes
0answers
9 views
Parenting over Network
I am working on a co-op game using photon unity, I am using parenting to move my object with respect to other, when I am setting my object parents to null one more copy is being created and being left ...
0
votes
1answer
44 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
69 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 ...
0
votes
1answer
28 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
25 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
63 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
63 views
Can I use sin or cos for the non uniform rotation in unity 5?
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
44 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
63 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
57 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
38 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
72 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
50 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 ...
0
votes
2answers
108 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
36 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 ...
2
votes
2answers
73 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
90 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: ...