C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
0
votes
1answer
20 views
AutoFill function and methods not working in unity 5.3.5
I opened one of c# code in my projects, and edited something in the code, and I noticed that MonoDevelop no longer gives auto filling of function and method options.
Below is the screen shot of the ...
0
votes
0answers
14 views
generic class inheritance [on hold]
I've got a few classes. One group contains information required to generate projectiles (It's simplified for explanation purposes):
public class ProjectileInfo {
public float InitialSpeed = 0.0f;
...
0
votes
1answer
15 views
Monogame - custom json content importer
I am trying to build a JSON tile map importer for the content pipeline of Monogame but I'm having difficulty doing so. I have been following this tutorial and got something... But now it appears my ...
0
votes
0answers
13 views
How to use touch.deltaPosition properly?
I use following code for measure touch delata position:
private Touch firstDetectedTouch;
public Vector3 dragDistance;
void Update() {
if (Input.touchCount > 0) {
...
0
votes
0answers
7 views
How do I add EventTriggers to Multiple instantiated prefabs from a list?
I have a prefab which I am spawning a dynamic amount of.
I want to attach an event trigger to each one of them, on pointerclick, to call a method accepting an int as parameter.
I have the following ...
-1
votes
0answers
16 views
object is not smoothly moving using lerp and onMouseDrag
This is the code to move my object using lerp and mouseDrag event but it is not working very smoothly.
//Camera Point smooth movment
if (mouseWorking)
{
if ...
0
votes
0answers
16 views
Unity 2d variable has not been assigned when trying to instantiate
So I have some code here:
using UnityEngine;
using System.Collections;
public class boardManager : MonoBehaviour {
public GameObject GrassTile;
void Start() {
for (int i = 0; i ...
0
votes
1answer
54 views
How to keep a rigidbody on the ground going up/down a slope? (Unity 2D)
I'm not sure if this is possible, but Im working a 2D project to has randomly generated loops (imagine a sin or cos graph). I have a 2D character (a quad for now). I want my character want to ski a ...
0
votes
1answer
20 views
Slow collision detection at low frame rates
I'm experiencing an odd issue with my collision detection. I'm using the Update method to move the player (I don't want to use FixedUpdate because that creates an undesired weird movement). The fixed ...
0
votes
1answer
33 views
How can I use web browser controls for non-browser game GUI?
I'm looking for a way to get a modern browser's level of customization and rendering quality in my c# monogame to avoid using roundabout/limited/buggy GUI toolkits and to get better fonts without ...
-1
votes
0answers
24 views
Car animation bypass another Car animation
I have several animated car objects which have their own animation and animation control script. The car object is racing on the road and I want to manage all the car animation i.e.,
if any car is ...
0
votes
1answer
18 views
Mesh Chunk Combining and Extruding
So I'm working on a proceduraly generated level, that is composed of multiple chunks, so you don't go over the maximum amount of verts allowed in Unity Meshes.
Another function is the ability to ...
0
votes
0answers
21 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
1answer
37 views
How can i show all edges in monogame?
I am using Monogame 3.5 and i have simple model of cube. I use BasicEffect to draw it. I want it transparent so i use effect.Alpha = 0.5f. Is it possible to show all edges something like on picture?
...
-1
votes
2answers
74 views
Why doesn't Unity keep keydown states between scenes, and how can I change that?
So basically, when my scene in Unity changes and I'm holding down, say, Right or Left, when the scene resets, my player (and Unity) doesn't even recognize that I'm still holding that button, until I ...
0
votes
0answers
20 views
C# player animation issue (animator is not initialized) [on hold]
For some reason the console says the animator hasn't been initialized. What am I doing wrong in my code???
//Creating a new animator object
private Animator anim;
// Use this for initialization
void ...
17
votes
2answers
3k views
Player jittering against wall when held down button
So, I'm making a top down RPG.
Everything's going excellent, but this problem is quite annoying. Now, when the character moves against the wall, the player jitters back and forth. I'm guessing it's ...
0
votes
0answers
30 views
I need advice on choosing the best data structure for a text mode game based on C# [closed]
I was assigned a work project which consists of making a RPG text based game, part of which is making the map itself and it's being a problem for me. I tried using a List<> of Tiles but that was ...
0
votes
2answers
43 views
How can I change my script execution order programmatically?
I have a script that I want to run before any other script. I want to change its execution order settings. I could do that using the Script Execution Order Settings option from within Unity, but I ...
0
votes
0answers
21 views
Unity - Remove GameObject [closed]
I have been developing a game in which we need to be able to select a GameObject (ingredient) and deselect it, and that by selecting that GameObject it adds a +1 to the counter. My objective is to use ...
0
votes
0answers
39 views
Which software to chose for 2d game development? Adobe Animate CC(As3) or Unity3d (C#) [closed]
Im currently a freshman right now and Im trying to figure out which software is best to use over my time in highschool to improve my development skills in general.
0
votes
1answer
35 views
How to set only one collider with OnCollisionEnter(Collision col) in Unity?
I tried with this:
void OnCollisionEnter(Collision col)
{
Debug.Log("hit everything");
if (col.gameObject.layer != LayerMask.NameToLayer("bico"))
{
if (col.gameObject.tag == ...
-1
votes
1answer
62 views
Increment int in array - int i is out of scope? [closed]
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
49 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
31 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
32 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
35 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
9 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
36 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
25 views
Type `UnityEngine.UI.Text' does not contain a definition for `Text' [closed]
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
14 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
15 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
32 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]);
3
votes
2answers
35 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
28 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
11 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
53 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
68 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
50 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
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 ...
5
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
53 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
80 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
40 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 ...
0
votes
3answers
49 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
33 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
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
42 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
62 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
19 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:
...