Quantcast
Channel: Latest Questions on Unity Answers
Browsing all 171066 articles
Browse latest View live
↧

Sliding cube around on x/z axis with a constant y-axis

Hi, I have tried several ways of doing this but I cannot get it right. I'm basically sliding a cube on a plane. The plane is just there for visual effect. I don't want to use a rigid body, etc. I'm...

View Article


Make a object stop rotating on collid

So my i have made a player, that player needs to push a ball. but when it pushes the ball it begins to rotate. on the x axe. How do i make it stop rotating? its a 2d rigidbody so i can't use constraints.

View Article


Can virtual joysticks be used as joysticks in the input menu

I am trying to make a game for Android, and want to use the dual joystick prefab to control the character however i need a rigidbody controller and do not want to modify too much of my code. I would...

View Article

how to make Time in your game while you play?

I want to have time so when the player finish the game.. i record it in leaderboard? help me please i dont know how to create this simple leaderboart thankyou in advance :/

View Article

Trying to play sound when key is pressed

Im trying to play sneakSound when space bar is pressed, which it is but its keeps playing every frame, I've tried Input.GetKeyDown, but then the color change that happens only shows for one frame and...

View Article


Screen size correct in editor not in web player.

I've set my unity screen size in editor to web player aspect. Scaled and organised everything accordingly. Built and run. Everything is completely out of whack as you can see. Is there a reason this is...

View Article

MathF.SmoothDamp

Hey, I'm trying to simply translate the camera from one position to the next. I'm getting the error;> Assets/Scripts/InGameGUI.js(471,46): BCE0023: No appropriate version of...

View Article

Event Mouse not working correctly

Im working on a custom editor, and the problem is, a simple Event.MouseDown and Event.MouseUp isn't working correctly at all. Code: using UnityEngine; using UnityEditor; using System; using...

View Article


A game empty object wont turn with its parent..

I am making a gun I have made 3 times, only time encountering this stupid error. the bullet comes out of a game emptys front position, but when I move my gun, its forward stays the same -_- the empty...

View Article


SetActive is broken

I encountered multiple occurrences, where GameObject.SetActive doesn't work. In some cases I get problems with "false" in other cases with "true" values. I workaround these issues by having repeated...

View Article

Making an enemy follow the player if the players transform doesn't change.

I've got an enemy coded for a project I'm working on. The enemy is supposed to look at and follow the player once they get within a certain distance. The problem is, recently we've started using a new...

View Article

string on GUI.Button not showned

I am sure that inventoryItem.Name contains "Wood" cause i see it when i add a breakpoint. Still i get nothing in the game. Just empty buttons. void DrawInventoryContent (int id) { var buttonIndex = 0;...

View Article

Automatically generate UVs for an imported mesh?

Is there an algorithm or functionality for automatically generating UVs for a seamless texture of a certain size? Would it be possible to used the automatic lightmap UVs for the texture? any...

View Article


Combing Quaternion Rotations

Hi guys, I'm trying to combine quaternions so that two rotations I make are combined. Every frame I'm rotating a game object in it's Y axis (Rotation A): transform.rotation = Quaternion.AngleAxis (...

View Article

Killing other players by touching them

hello i am working on a multiplayer fisrt person tag game, where the hunter kill the other by touching them (actually would be better if the hunter kills if the player clicks on the mouse while is...

View Article


Can't seem to find Standard Mobile Assets: Joystick

Hello everyone... I have been the whole day trying to do something VERY simple, and I feel really frustrated... As you will realize soon, I'm a super noob on Unity (but I consider myself an experienced...

View Article

My text field is not taking any input

I am writing a GUI application for Unity and I have text box showing which is great but for some reason I can't enter any kind of text into it. Here is the class: /// /// Main function where the GUI...

View Article


How to make Sprite not Bounce on Collision (2D)

Hi everyone, i just started my experience with unity a few days ago and i got stuck with this problem that probably for the most of you is a stupid issue. I'm actually using the 2D setup , trying to...

View Article

Webplayer deserialization fails

Hi there, Usually i serialize my savegames to a file and this works yust fine and is super convenient, i just put my class [system.Serializable] attribute and can save it. So now i need to deploy to...

View Article

Moving A Ray Relative To Parent, Not World

How can I make it so the ray starts a certain distance away from the front of an object. So when the object rotates, the ray start point stays in the same relative position to the object. var ray = new...

View Article
Browsing all 171066 articles
Browse latest View live