How to rotate turret in enemy direction continously?
I have created an empty game object and turrets image which i have made a child object of the game object,whenever an enemy is spawned ,it beahves randomly doesnt tries to loook at the enemy...
View ArticleHow to rotate the turret in accordance with enemy?
i have a game object with a script attached to it,i want to rotate it arround the z-axis,and make it continously point toward the enemy moving,currently my turret is rotating around z-axis but not...
View ArticlePrefab or copy of game object behaving strangely.
It is really hard to describe this issue, but I am at a total loss as to how to solve this. I have a 2d character with a really simple character controller that allows him to move back and forth jump...
View ArticleMove infinitely in targeted direction
For my game, I want to move my game object in specific direction but it has to travel any number of units. At present I have following code for deciding direciton. Vector3 direction =...
View ArticleLinerenderer disappears or doesn't change after mirroring x axis
Hello! I'm working on a 2d project. I have a linerenderer not using world coordinates with only two positions: (0,0,0) and (10,0,0). The linerenderer is attached to the object gun that is found in this...
View Articlehow to: make global variable
hi, i am newbie in unity. before i use vb.net. in vb.net we can create a module just for containing our global variables that can be used in all forms. can i achieve that feature in unity? the real...
View Article2D Parallax movement
Hi, I am developing a game, in which I need to develop 2D parallax with multiple layers. The problem is I found 2 solutions for this on the forum: 1. renderer.material.mainTextureOffest = new Vector2...
View ArticleMultiple languages support
I want to add multiple languages support for 2d game such as japanesse, french etc. At present game exist with english language only. I have created text with tk2dTextMesh. If I directly pass another...
View ArticleFont blurring in Ipad
I am using tk2dtextmesh to display text. when I create new tk2d font and set in tk2dTextmesh, it works fine in unity, but in ipad its blurring too much. I want suggestion in this.
View ArticleGameState Script Problem
Hi, i'm just a newbie who develop a 2d infinite runner game. i was following a tutorial and remade with my own asset. I got a problem when make the GameState script. here the script using UnityEngine;...
View Article2D Grid Movement (turn based)
I trying to create a Turn Based Strategy behaviour where you move a gameObject from 1 tile of a grid to another tile near it I have created the Grid using sprites as gameObjects but can't sort out the...
View Articlelinecast detect between two points
Hello! I know this question has been asked already, but I cant seem to solve my problem. I'm trying to detect a box with the tag "Player". I've seen a few videos and answers but its just not working....
View ArticleCREATING CUSTOM CHARACTER
Ok. I need to build a custom character that is fully animated in Unity 2D. I enclosed an image of the character and what I need him to look like. The fingers need to be poseable and so do the arms on...
View ArticleUnity2d Set Different Physics Properties on Gameobjects (potentially at Runtime)
I currently have two gameobjects of the same prefab interacting with physics but cannot get the right settings to make it do what I want. ![alt text][1] ![alt text][2] What I have is: When I make the...
View Articlematch3 reorganize rematching
i am making game like candy-crush etc style. i got success in making it to swap,to match3, to reorganize but fail in rematch3. the game will go idle (hung / crash, don't know). anyone can help? in...
View ArticleContinuously move ball on screen
For my 2D game, I want to move ball continuously on screen. At present, I have following code to work. public class BallMovement : MonoBehaviour { private bool isStartMoving; private Vector3 direction;...
View ArticleUnity2D onTriggerExit2D not working!! Help!!
Hey guys, So basically I am creating a 2D platformer with Unity and I have run into a problem. I am trying to create a boundary box around my map, so that when enemies inside hit the edges of the map,...
View Articlerotation issue
Hello, I am developing tap like game. OnMouseDown I increment eulersAngle by 120. when it reaches to 360,it continuously keeps rotating, means not stopping on 360. here is my code : void Update () {...
View ArticleChange the Material of a Sprite with C#
I am looking for a way to change the material of a sprite during runtime. I have created a material called Ghost and placed it in an asset file called Shader. Changing the material works just fine when...
View ArticleCount how many items are touching to a certain object
Hello, As a beginner, I'm stuck at some point. I have a rigidbody2D object, at a given moment I want to check how many items are touching to that object. Say I have a floor and lots of balls (it may be...
View ArticlePlayer won't stick to moving platform.
I have created some moving platforms for my game. There's a game object called PlatformPath1 which has children that define the start and end of the platform's cycle and then obviously there's the...
View ArticleHow to play sound on destroy (Unity2D)
I am making a 2d game and it has coins and when the player touches the coin I am trying to make the coin disappear and make a ding sound .the problem is that the coin disappears but no sound. using...
View Articletrouble setting map boundaries of top down 2d shooter
I am creating my first unity game which is a 2d top down shooter. I am very happy with how my player is moving around the map but I am having trouble setting up boundaries around the map. I am moving...
View ArticleAlmost any object can play a sound. They all need an Audio Source?
So, simple set up: 1. My game has 100 objects spawned. 2. These objects have a chance to play an ambient sound from an array of audio clips. Do all 100 objects need an Audio Source? I mean, for a...
View ArticleUnity2d : Spawning in Prefabs
My question is how to randomly spawn in objects on the screen with out them spawning in over each other? and if there is no room to spawn, then they wont spawn, and will wait in line or get canceled...
View ArticleGameObject starts drifting on X axis when doing high jump
Hey guys,my player game object keeps drifting on the X axis when he does a jump off platforms. This especially happens when he is high up, and during the jump I cant control where he lands! Below is my...
View ArticleSprite with rigidbody2d wont "glide" when gravity is 0
I have a flying plane(sprite) that has a box collider2d, controller script(named Pilot), and a rigidbody2d ![Image1][1] [1]: /storage/temp/38324-inspector.png The plane has an empty GameObject as a...
View ArticleUnity UI System: How to click a button under an image
Hi everyone, Please take a look at the photo below. I have a button under an Image. I want this button clickable when I click over that image. How can I do it? Thanks. ![alt text][1] [1]:...
View ArticleBickford fuse as timeline in game process
Hello. I want to show the burning bickford fuse as the remaining time before explosion in the game, but I can't understand how to do it correctly. Options: 1) Remaining time is NOT a constant, so I...
View ArticleDoes Unitys built-in Sprites dynamic batching work differently and add more...
Hi All, I've put together a performance simple test using Unitys built-in 2D support. I have an ortho camera, a sprite prefab and some logic that spawns more and more of the same prefab which I click...
View Article