Questions tagged [unity3d-2dtools]

Use this tag if your question is about using Unity's built-in 2D features, like the Sprite type and the 2D physics engine, based on Box2D.

The 2D Tools refers to the collection of tools to make 2D applications.

Useful links


Related tags

492 questions
0
votes
1 answer

Unity3D 2D Resetting 2D object position

I have the below script attached to an object. When it hits the left or right wall, I want to recenter the object but it doesn't seem to reset the position. I do see 'hit wall' in the debug window. function OnTriggerEnter2D (hitInfo :…
Tsukasa
  • 6,342
  • 16
  • 64
  • 96
-1
votes
1 answer

Spring Joint 2D (maybe) causing transform.position errors

I know the title might be misleading after you see what is the problem, but I really don't know how to name this issue. The first picture shows the problem. The white line shows the distance between the player and the gameobject called hook. The…
-1
votes
1 answer

If disable/enable collider the animator doesn't work anymore

I have a character with BoxCollider2D and Animator components. I need to change a physic material's friction dynamically so I use the next function: private void ChangeFriction(float friction) { boxCollider.sharedMaterial.friction = friction; …
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
-1
votes
1 answer

Using PointerEventData returns error: "Unexpected symbol"

I am new to C# and decided to start using it for now since most of the Unity tutorials are focused on it and I've never used JavaScript for anything other than webpages. For the most part everything was working until I tried using the…
-1
votes
2 answers

Using Wait in C# (Unity)

I have this code: void Update () { // If the fire button is pressed... if(Input.GetKey(KeyCode.Z)) { // ... resetEvent.Wait(timeout)set the animator Shoot trigger parameter and play the audioclip. …
user8488959
  • 57
  • 1
  • 6
-1
votes
1 answer

How do I move and flip my character in Unity2D?

I am new to Unity. I am playing around with a 2D sidescroller. Here are the features of the script I am trying to write: Move left and right Flip character when changing direction Increase speed to a cap while continuously moving Currently, the…
Pareod
  • 151
  • 1
  • 11
-1
votes
2 answers

How do I access booleans from another scene?

I have a script called dataSheet attached to the GameObject DataSheet. How do I access booleans in it from another scene?
Sharpy
  • 143
  • 2
  • 8
-1
votes
1 answer

How do you keep a shot moving in the same direction/velocity after it has hit a target while allowing targets to bounce off of obstacles?

I have a shot that gets fired from a turret which needs to be able to hit multiple targets (once it hits one target the target disappears and the shot should continue in the same direction with the same velocity and can continue on and hit others).…
coe720
  • 84
  • 2
-1
votes
1 answer

Unity Button to control playing of music(Changed code)

I want to create a button playing of music with a button but I don't understand how can I get the button and do functions with it. In addition to making music stop and start, I also want to change the button image to indicate whether the music is…
UnityNewb
  • 361
  • 1
  • 5
  • 17
-1
votes
2 answers

How to move an object without going through colliders

I'm using Unity and i am doing a pong game. I would like to be able to move the paddles with the mouse key. I have tried just moving their position but that of course will simply "teleport" them through the colliders along the edge of the playing…
user65909
  • 101
  • 1
  • 9
-1
votes
1 answer

Unity3d move object with some force

This is what i try to achieve in 2D: A GameObject A button A scene 1) I push the button 2) The GameObject comes in from the side like someone are throwing the GameObject into the scene meaning it have some speed that blends off and stop I know i…
PeterK
  • 4,243
  • 4
  • 44
  • 74
-1
votes
1 answer

Move gameobject to click position in unity 2d

Is it possible to move a gameobject to click position in unity 2D while gameobject is a rigidbody 2d with gravity and movement looks like jump from gameobject's position to click position. Any help reference will be really helpful :)
Anil
  • 15
  • 1
  • 8
-1
votes
1 answer

Connection with SQLLite on Unity3D using Javascript in Android

How can connect with SQLLite from Android using Unit3D and Javascript? Someone can'i help me?
Dimmy Magalhães
  • 357
  • 1
  • 6
  • 21
-1
votes
1 answer

function won't run in unityscript

I new to unityscript and am making a platformer game in Unity 2D but my character Movement script won't work. I assume that the function isn't being called but it used to work. this is the code: #pragma strict var JumpSpeed : float = 10; var…
-2
votes
1 answer

Accelaration coding in Unity for vertical game

I used a code to make my game get faster the longer the game lasted but the problem I faced there was that the actual screen got faster rather than the player and blocks it jumps on and eventually the player would no longer be in the screen. Is…
Cem Ozsoy
  • 49
  • 1
  • 6
1 2 3
32
33