C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.
0
votes
0answers
2 views
Unity 5: How to handle stacks of “windows”
I'm having a hard time coming up with a clean and simple way of implementing a window manager of sorts. I have placed some limitations below:
Windows can never move and its positions are fixed at ...
0
votes
1answer
15 views
How to save options at the game?
In my game main character can move using tap or hold finger on the screen. I wanna create at the menu options, and there button to change control type.
How I can save player choose? Using Prefs?
1
vote
0answers
30 views
Creating a planet out of an existing terrain
I am creating a game that I have created a terrain for. I really like the terrain so I am wanting to keep it but I want to have the game take place on a full planet. Avoiding paying $200 for an asset ...
-1
votes
2answers
29 views
change the image of button click in unity2D
I want to change the image on the button click.I have two two button(front and back).When I click on front button the image should get changed.When I click backward the previous image should be loaded....
2
votes
0answers
24 views
in unity does a reference delegate clear out when its parent gameobject is destroyed?
if i have a gameobject with a component like some:
class SomeComponent : MonoBehaviour
{
System.Action DoStuff;
}
class SomeOtherComponentInAnotherGameObject
{
public GameObject ...
1
vote
0answers
17 views
Unity : Android Button : Select (Highlight) by touch, before clicking
I have a multiplatform game with dozens of buttons in many menus.
I used the animated buttons setup to have a normal state and highlight state. Highlight will most of the time resize the button with ...
1
vote
2answers
40 views
Coding style about collisions with geometry
Let's say I'm writing 3D Pacman. I have "Dot" objects throughout my maze, that are structured as follows in the Inspector:
Dot (GameObject)
- Sphere w/Collider
When I run into the sphere trigger, ...
-1
votes
0answers
28 views
Problems with visual studios [on hold]
Hello i dont know why but visual studio dont detect when i writh codes like Vector3
0
votes
1answer
20 views
Using AddForce() to implement a follow script
Not looking for an implementation to the problem (although that would be good :P), mainly looking to be pointed in the right direction for solving it.
Basically, I want to have various game objects ...
1
vote
1answer
62 views
On screen enemy indicating arrow
I am working on indicating on screen arrow to point towards the enemy. I have a environment which consist of a player and three enemy placed at different position on the environment.I need an arrow ...
1
vote
1answer
48 views
How to leave a permanent skidmark on the ground in unity2d
I am working on a 2D driving game.I have a sprite of a car.Set the car movement.Now I need to create a skid mark on the ground
for that I have created a empte game object and added Trial Renderer ...
0
votes
1answer
25 views
draw only on stencil buffer monogame
Exactly as the question says. Is there a way i can draw vertices only into the stencil buffer.
Basically i want to perform some operations on some vertices of a mesh and based on the result, draw ...
1
vote
0answers
36 views
Fading back and fourth Unity Image alpha
I'm trying to create a way in which if I press a button, it'll highlight other objects whilst at the same time fading other objects. I also have other buttons that will fade and highlight different ...
1
vote
0answers
32 views
movement control with the 2D driving game
I am working on a 2D driving game.I have a button(forward).I need to move the vehicle by pressing on the button.
When the button is pressed the vehicle should accelerate upto its maximum speed and ...
1
vote
1answer
31 views
UI Bug After UI has interaction
I am making a 3rd person game for pc. Space, of course, makes the player jump in game. For some reason if I interact with my menu at all and then press space it will open my menu back up. This doesn't ...
0
votes
1answer
36 views
Hold touch at the screen to move object
I'm using unity2D and C#, and I have a code for touch screen:
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Began)
{
...
0
votes
1answer
38 views
How to place text centered on the player? XNA
As I can make a text of the size of this, it is centered taking reference of the player?
Right now the following happens:
I want:
code:
spriteBatch.DrawString(Font, player.Name, new Vector2(...
0
votes
0answers
27 views
Unity: Initializing smoke Prefab via script
I am trying to use a smoke prefab (free asset fro Unity asset store). When I add the prefab directly into the game scene, the prefab works:
But when I create the following script to initialize the ...
1
vote
0answers
44 views
Flow effect to static water on a isometric city
Hello everyone I want to give the idea that the river in my city is flowing but I am having an hard time to figure how.
Do you have any idea of what I should look into to?
0
votes
1answer
19 views
XNA player/tile collision not working perfectly
So I've built a map tile engine in XNA, and have been working on the player/tile collision. The method I'm using works well to some extent, but the player will often move through the walls and get ...
0
votes
1answer
60 views
How do I detect if two 3D box shapes are overlapping each other?
I'm creating a Unity game, and for my building system inside the game, I need to detect if 2 3d box shapes are overlapping each other. What I'm doing this for is, lets say I'm building a wall, I need ...
0
votes
1answer
20 views
Unity 3D - Rotate (smoothly) towards a target
I wanted to know if there is a method on which I can rotate an object with an angle given (a float to be precise), I use trigonometry to calculate the angle between the two objects in a (x, z) plane ...
-5
votes
0answers
71 views
Very Beginner! Need help coding for Unreal Engine 4! [closed]
I am truly a very beginner and I am an aspiring game designer and developer. Of course I realize it Is good to start with easier things. I have done a lot of very good highly rated online training ...
0
votes
1answer
26 views
jsonutility doesnt exist in the current context
I am working on converting a string into json format and sending the json formatted data to the server.Everything is working fine. I tested the project and exported the project.Current version of ...
0
votes
1answer
52 views
Random move to certain points?
I want my enemy to move randomly to certain points on the scene. It moves to one point and then stops! It does not continue to the other points!
Here is my script:
using UnityEngine;
using System....
4
votes
2answers
120 views
Ideas/suggestions to implement an item combination system
I'm designing a game where there is a relatively small set of items. A single player holds an inventory of item slots. Each item slot contains a single item. The inventory allows you to use the item ...
0
votes
1answer
75 views
How to make the AI Chase in Multiplayer
Im Currently develop a little Dungeon Crawler. The Singeplayer works fine, but it also should have multiplayer so i implemented it. But there's one problem. I have no idea how to make the AI chase the ...
0
votes
0answers
29 views
Unity Scrollview reduces size of items added to “Content” at run time, but works fine adding in editor
I am facing this ridiculously stupid problem which I am sure has a simple solution to it. I was following the brackeys tuorial for a server browser for a multiplayer game using scroll view. (Posted ...
0
votes
2answers
30 views
Storing Highscores using PlayerPrefs in Unity
int highscore = 0;
void Update()
{
storepoints();
print(PlayerPrefs.GetInt("highscore", highscore));
}
void storepoints()
{
if (points>highscore)
{
highscore = points;
...
3
votes
1answer
58 views
How to create data driven effects/abilities for collectable card game
I'm trying to create cards for a ccg/tcg that are completely "data-driven" from an xml/json/external file. I've read multiple articles on this issue already, even here on stack exchange, but i can't ...
0
votes
0answers
17 views
Unity - Trying to get mic input to speaker; MissingComponentException
I'm trying to create a basic Unity project where any audio heard by the mic will go out through the speakers / headset. This is primarily for mobile, which at least have a mic ready, anyway.
Most of ...
0
votes
1answer
47 views
How to rotate within a fixed interval in Unity?
I have very recently started to learn Unity.
I'm trying to write code that will make a character swing a flag. I want to use this object and rotate the arm up and down. So I need to make it rotate up ...
0
votes
0answers
13 views
FInding out if a shape is enclosed by other shapes
I'm trying to programmatically work out if a 'core' shape is surrounded with other shapes and thus no space exists around it. Here's an illustration of what I mean (ignore white gaps, they are just to ...
0
votes
2answers
29 views
Unity turn the camera when the player turns
I have a 3rd person view of my player.
I wish my camera to follow the player both when he moves and when he rotates.
So far i have the movement correct:
public class CameraController : ...
0
votes
0answers
27 views
Camera follow rotation
I have a camera script where it follows the character, however whenever my player turns, the camera doesn't stay behind the player: it rotates but it stays left of the character, instead of right ...
1
vote
2answers
86 views
How Should I Go About Updating My XNA Game?
So, I've created an XNA game, but I'm not selling it... it's just a private game to give away to my friends, more of a practice project. But say I find a bug, or think of a new feature...
I don't ...
0
votes
0answers
14 views
Unity runs custom AssetPostProcessor every time on save
I've written a AssetPostProcessor script that make some changes to prefabs and materials on import in some specific folders. I'm using this method to do that:
private static void ...
0
votes
1answer
31 views
Converting to JSON String with JsonUtility.ToJson
I am working on converting and displaying the JSON String with unity. I have done coding for it
using UnityEngine;
using System.Collections;
using LitJson;
using SimpleJSON;
using System.IO;
public ...
0
votes
1answer
51 views
only one tile being drawn xna c#
I have been looking at tile engines for the past few days and decided to have a go at my own one for educational purposes. I want to use different textures for the tiles of my map, for example 1 = ...
0
votes
1answer
20 views
Attached objects to public Text removed on play mode (Unity)
As you can see when I play the game the 'touch anywhere to start' object goes away. How do I fix this?
I have added all the relevant code
1
vote
1answer
55 views
Applying a getButtonDown & getButtonUp on a GUI button for touch input
I have a GUI interface with a button for the character's attack, however I want to implement a defense button where the user can hold the button down to block incoming attacks, when the user stops ...
0
votes
1answer
28 views
Changing motion clips via script in Unity
is there a way in Unity to access the Motion clip of an Animator State and change it at runtime via script? I am trying to do a character shop in my 2D game. My idea is, when i click a GUI button it ...
0
votes
0answers
39 views
Change terrain texture in unity
I have two textures for my terrain. As a default I use the green texture. However I want my user to be able to change the settings of the game to make the texture red. I have buttons in place that ...
1
vote
1answer
71 views
Communicate Unity application via a series of Json
I am working on communicating unity application via a series of Json. Since I am new to JSON, I don't have any idea how that work with Wnity.
Here is my JSON structure
{
"id": “id",
"payload"...
1
vote
0answers
10 views
Children of canvas objects do not register OnMouseUpAsButton
Objects I create inside my canvas do not register the OnMouseUpAsButton() event. I tried doing it on an empty project and it doesn't work so I guess I'm misunderstanding how something works. That ...
0
votes
0answers
19 views
Why does the order of Farseer collision categories affect collisions?
I've discovered a bizarre issue with the Farseer Physics Engine that I can't figure out. I have two Farseer bodies that I'd like to only collide with each other. To that end, I have the following code....
0
votes
1answer
31 views
Finding if 2 polygons intersect using clipper library
After realising my code was pretty inefficient at checking for polygon overlaps, I've turned to a mentioned library Clipper but finding it difficult to know hot to use it for this operation.
I am ...
0
votes
0answers
29 views
Determine Wifi adapter address on Android with Unity/C#
This piece of (crude) code is able to find my Wifi NetworkInterface on my Windows 7 x64:
class WifiAddrTest {
IPAddress wifi_ipv4;
void getIP() {
foreach (NetworkInterface netif in ...
0
votes
1answer
51 views
Unity in c# errors with “the type does not contain a constructor that takes 0 arguments” [closed]
This is the problematic line
datosAguardar datos = new datosAguardar ();
Here is my code
public class estadoJuego : MonoBehaviour {
public int puntuacionMaxima = 0;
public static estadoJuego ...
1
vote
1answer
35 views
Finding when shapes overlap and lines intersect but exclude points/edges
I've been looking for a c# algorithm to help determine if shapes and lines intersect but want to exclude boundary overlaps. Here's an example:
My true problem is finding if polygons intersect but ...