Questions tagged [collider]

The tag has no usage guidance.

44 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
430 views

Zooming in a lot without having 3D objects disappear in the Unity Editor

I'm editing the 2D colliders on some objects of my game, and I need them to be very accurate, so I'm zooming in a lot. Problem is, since my objects are 3D graphically, when I zoom in a lot they ...
3
votes
0answers
122 views

Line Renderer 2d Follow the edge

I am using mouse position to draw a line using line renderer 2d. What i want is when the line hits a collider it should start to draw on the edge of the collider rather than over the collider. ...
3
votes
0answers
67 views

Unity: Messages in Compound Colliders

Lets say I have a 2D character with two colliders: a circle collider that represents the feet, and a box collider that represents the body. Lets say that the character is currently standing on the ...
1
vote
3answers
223 views

How to Make Border of 2D Game in Unity

I have a border by default. But, I'm having trouble detecting if my object collides with the border. I am looking for efficient ways to do this, and I am not sure what should I use. I thought using a <...
1
vote
1answer
34 views

Why does my collider behave strangely after a coroutine

So I'm trying to create a simple script that is going to handle the logic for cutting down a tree I'm experiencing some strange behaviour with my script. I have a private field which holds the "...
1
vote
0answers
138 views

Instantiated prefabs dont trigger ontriggerEnter while prefabs created not on runtime, do

I am new to unity and trying to make a bouble trouble game. I have enemy prefabs with BoxCollider with is triggered checked. I also have a shooting script. when I am trying to instantiate the enemy ...
1
vote
0answers
59 views

2D Rigidbody with Touchscript movement in Unity won't stay in boundaries

I'm trying to make a pong game where the player has to move both paddles. They are currently set as dynamic 2D Rigidbodies (collision detection continuous) and have a box collider (is NOT trigger) ...
1
vote
1answer
49 views

Dragging a Rigidbody2d without moving other Rigidbodies

There are obstacles and other objects that are draggable. Colliders and dynamic rigidbodies are on the draggable object and there are colliders on the obstacles. The problem is that with the ...
1
vote
0answers
639 views

Unity2D TileMap Collider Update Optimization

I'm currently working on a 2D tile-based side-scroller (similar to Terraria). I am using Unity's TileMap feature to draw tiles onto the screen and have my player collide with them as if they were ...
1
vote
0answers
39 views

Box collider has different behavior in 2 clients

I'm new to Unity. I am making my first Game and faced with problem. I have a plane and 4 gameobject that has box collider surrounded this plane. there are a few spheres as players inside of the plane....
1
vote
0answers
25 views

Capsule collider triggered unexpectedly

I have an object with a capsule collider on its root, with IsTrigger=true (triggered by the player). The trigger works fine, but is also triggered unexpectedly some ...
1
vote
0answers
130 views

Detect when any part of a collider leaves a trigger zone on Unity 3D

I've searched all over for a simple solution on this, and found posts as old as 2011, with a bunch of hackish ways to badly work this out. I want to detect when ANY part of a collider leaves a ...
1
vote
1answer
314 views

Unity3d How to add collider to borders

I have a box with a hole in it. Is it posible to add a collider only to the dark blue showed at the img? (But only at the borders, not a box collider. Let's say i want some object to get in the box, ...
0
votes
1answer
23 views

Position of Gameobject Changes When Hit Play Button

I have a 3D Humanoid model. When I press play button, suddenly position of model changes and collider doesn't match with model.
0
votes
1answer
26 views

RaycastHit2D.point is acting weird when used with circlecast2d

When I make circleCast2d intersects with another circle collider, I get a RaycastHit2D.point that doesn't point at the tip of ...
0
votes
0answers
13 views

Circle collider wheels push through polygon collider car chassis

I'm trying to create a simple vehicle and make it run on a terrain (from sprites + PolygonCollider2D). I imported a chassis sprite with ...
0
votes
0answers
20 views

Endless runner character stops moving unexpectedly

I've been trying to make an endless runner game in Unity in which a player moves forward automatically and can move from x to y axis while still moving forward. I do not know how to program so I used ...
0
votes
1answer
41 views

Why isn't my tilemap collider appearing?

I am trying to make a 2d game but my player falls through the tilemap every time. My tilemap collider doesn't seem to show up. What is going on and how do I fix this? The first image is rigidbody ...
0
votes
0answers
36 views

Unity: Have raycast penetrate through other colliders/triggers

I have a setup where an enemy prefab has a trigger box that is in front of it: Box and enemy itself is in the Enemy Layer. Now I want to project a raycast to the Player, which is in Player layer. [![...
0
votes
0answers
10 views

Sync Collider size with bones in model

I'm setting at runtime a BoxCollider2D size by taking the difference between the Y position of two bones on the model... but the size I'm getting out of this ...
0
votes
1answer
119 views

Two Colliders on the same GameObject for different purposes

I'm somewhat new to Unity and am trying to build a battle system. Right now, I have an attack that checks collisions with enemy objects like this: ...
0
votes
0answers
61 views

Collider inside another collider: Move the brain via mouse while being able the click the spheres

The spheres have a sphere collider on them and are clickable via this script:Clickable.cs ...
0
votes
3answers
400 views

Jittery collisions in Unity 2D

I tried to implement a simple movement to my object. My object moves perfectly fine but I'm having issues with its collision. When I keep on moving object towards the obstacle/ground, collision are ...
0
votes
0answers
214 views

(Unity) how to write my own raycasting functions

I am making a game in curved space in Unity and I am trying to figure out the best way to handle raycasting. For my purposes the Ray struct doesn't carry enough ...
0
votes
1answer
133 views

Tetris block kinematic rigidbodies pass through one another with Transform.Translate

I am trying to build a Tetris 3D game in Unity but I am stuck at getting the different blocks to interact (to detect each other, to sit one on top of the other rather than going through each other). I ...
0
votes
1answer
42 views

How do you allow joints in a character to fall freely based on gravity?

I am building a game in Unity in which a character falls down on death. Is it possible to make the joints fall and bend based on gravity? That is to leave the joints fully dependent on gravity and ...
0
votes
0answers
25 views

Creating valid virtual creature with 3d Boxes

I'm creating this project in unity.Karl Sims, the creator of the project, published the paper describing the project. In order to create the 3d creature like in the video, I'm using 3d boxes and ...
0
votes
1answer
151 views

Colliders slightly intersecting each other; any solution?

Consider this simple scene: In Unity, colliders slightly intersect each other. Typically, this isn't a problem. However, I want to make a custom character controller using a box collider and not a ...
0
votes
1answer
970 views

Unity's Box Collider isn't preventing an object from falling through the floor

I'm working on a little "Tower of Hanoi" AR game in Unity using Vuforia, where the game is projected onto an image target. Now I wanted to make the rings "fall" into place, so I added an invisible ...
0
votes
1answer
142 views

Unity get reference of GameObject under another GameObject

I am trying to get reference of the object underneath my Player. I don't know if I am aproaching this correctly. Right now, I have a player simply put in the scene, like this: Then I am trying to ...
0
votes
1answer
184 views

How to make a collider the follows all the animations of a prefab?

I have attached a capsule collider with my player(prefab) and made a script so that when Space key is down it does the jump animation in Unity. But because of the collider not jumping with the player, ...
0
votes
0answers
101 views

Rotating a vehicle to match a 2D slope

I have a vehicle that needs to move on a randomly generated terrain and handle slopes. I'm not using wheels, but instead moving the vehicle with velocity. The ideal case would be if I can make the ...
0
votes
0answers
58 views

My gameObject does not move, when it returns to its original scene

I have a map where I have a 2d Ship as gameObject, which can be dragged with the finger to travel between islands and do the corresponding activities, when the player finishes playing on the island he ...
0
votes
0answers
161 views

Is a simple PolygonCollider2D really worse than several BoxCollider2Ds?

In my scene I have very simple quadrilateral blocks, which I'm considering using PolygonCollider2D for. These blocks will be the building blocks of the scenery so ...
0
votes
0answers
24 views

Unity: finding force vector to separate colliders in OnTriggerStay events

In Unity, I have Trigger Colliders, and catch the OnTriggerStay(Collider other) events. Once two Colliders are touching, how do I get the Force vector to make them want to separate again? In the ...
0
votes
0answers
27 views

How do I transform from local points to world when using a scroll view?

I'm using a scroll view to store my game character icons (basically an RPG). The movement system for the characters is tile based, but in game hazards could be located anywhere. So I need to detect if ...
0
votes
1answer
235 views

Resize rigidbody in runtime, Box collider OnTriggerEnter not work

Scene setting: Object A: Rigidbody, kinmeatic Box collider, is trigger true. Object B: Box collider, is trigger true. Script is on Object A: ...
0
votes
0answers
194 views

How can I get visually accurate collision normals with sphere collisions?

I'm solving simple 3D sphere collisions by checking the sphere for overlap with a mesh, finding the nearest point on that mesh's surface to the center of the sphere, and then resolving the collision ...
0
votes
0answers
780 views

Detecting collisions without rigidbody

I have a car with the following aspect: As you can see, colliders are locally static, because they are separated from the original rigidbody component. Well, as you can suppose, I have a problem, ...
0
votes
0answers
47 views

Marking up 2D polygon perimeter on an image

I'm working on a 2D game in JavaScript using the Web canvas. I plan to use AABB proximity detection and then point, line and polygon on polygon collision detection. Which means I need to define ...
0
votes
0answers
70 views

Get number of sides of a shape created with LineRenderer in Unity

In my game I'm using LineRenderer to draw a line at every mouse click. As you can see, everytime the lines collides with itself it creates a new shape. I'm able ...
0
votes
0answers
724 views

Unity Generating PolygonCollider from mesh

I generated a procedural mesh using marching squares and the MeshFilter component (it's 2 dimensional). Now I got the point that I need do collision detection with ...
0
votes
1answer
38 views

'Edit Collider' exits after every adjustment

When I click the Edit Collider button I can see the collider's region and the handles to adjust it. After every adjustment (with the mouse) the collider outline disappears as Edit Collider finishes. ...
-1
votes
3answers
397 views

How to add collision to this script in Unity

I Want to be able to have collision were my player can't go through objects with colliders un Unity but I don't know how to make that happen, can you please help? ...