Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [collider]

The tag has no usage guidance.

0
votes
0answers
12 views

How to move cube touch position and when hit my collider then stop my cube using raycast? [duplicate]

cube will be move but when hit my collider not stop my cube,used in program raycasting Code: public class MoveCube : MonoBehaviour { float speed = 0.5f; public Animator anim; ...
0
votes
0answers
24 views

when my cube touch the collider then stop my cube? [duplicate]

I put Box Collider on my obstacles but not stop my cube when touch the collider i try some code but nothing will be happen. ...
0
votes
0answers
23 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 ...
0
votes
1answer
27 views

How can I add different colliders to each body part of a character in Unity?

I have been using unity game engine for about two weeks now. And I'm very interested in 3D game development. I have been learning basics of Unity and third person games. I saw many tutorials about ...
0
votes
1answer
29 views

MoveTowards object stuck with isTrigger Collider

I am trying to have a missile seek its target once it has entered the target's trigger. The code should be fine, I think it has something to do with how the colliders are operating. I want the blue ...
1
vote
1answer
75 views

Why do my NPC's fall through the world when I select them as triggers?

I'm making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC's have rigidbody as well as using gravity and convex....
0
votes
1answer
37 views

How to transform Capsule Component in UE4?

The collision of the character with the environment only works correctly (in the eyes) when I use the original skeletal mesh. I tested it in the most varied sizes and it worked perfectly. It turns ...
0
votes
1answer
25 views

Large gap between the grabbed game object and controller

When i grab a gameobject, there is a gap between them. I have tried changing the scale of the colliders, tool handle position from global to pivot but nothing worked for me. Should i reset the pivot ...
1
vote
1answer
51 views

Unity tilemap collider not colliding with rigidbody

In the wireframe you can see the tilemap collider for this hill. The red circle falls right through however. The circle has a 2D rigidbody attached. Everything is on the Default sorting layer and on ...
0
votes
1answer
39 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...
0
votes
0answers
26 views

Unity — Proper algorithm for a Character Controller that automatically fits mesh?

I'm trying to make an algorithm that will automatically generate a CharacterController component (on a parent-GameObject) which should automatically resize to whatever the current mesh size is. To ...
1
vote
0answers
35 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....
0
votes
0answers
18 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 ...
2
votes
0answers
35 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 ...
0
votes
0answers
11 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
21 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
93 views

Unity Hit Collider GameObject is Null when Collider is Child (Line-of-Sight Detection Problem)

I'm creating line-of-sight code in Unity. It allows a radar to check whether it can see an object, or whether the object is behind an obstacle (a collider). Similarly to Unity's suggestion, I check ...
0
votes
3answers
109 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? ...
2
votes
0answers
77 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. ...
0
votes
1answer
104 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
1answer
51 views

Unity - OnTriggerEnter & OnTriggerExit strange behavior

I am having a trouble with OnTriggerEnter with a lot of objects. I have a NavMeshAgent moving randomly throught the scene, then I have a sphere collider inside a children to detect nearby objects. If ...
0
votes
1answer
48 views

Unity: How many Raycasts per Sphere Collider?

I understand that a simple sphere collider in Unity is a raycast in all directions with a certain length. How many Raycast events does a sphere collider trigger? At what degree increments are the rays ...
0
votes
1answer
297 views

How to give individual tiles their own collider in Unity's tilemaps?

My floor tile is a 2D drawing of a 3D platform, for lack of a better description. I want my player character to stand not on the top of the tile but a little inside it, as the red circle does in the ...
1
vote
0answers
14 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
1answer
58 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
0answers
95 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
1answer
65 views

How to know the point of collision with another object in Unity5

I have a small problem and it would be very helpful, which could guide me. What happens is the following, I have an enemy (evil usb) in my scene, to the collisionar this enemy with my main player ...
0
votes
0answers
123 views

Physics.IgnoreCollision not working right after invoked

When invoking Physics.IgnoreCollision in Unity, it seems work but it still have collision detection right after creation. I have this issue with ejecting empty case after gun fire, it's spawning ...
0
votes
0answers
222 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
1answer
142 views

Can I test collision inside an edge collider area in Unity?

I draw a triangle with the edge collider2d and I want the player to make an event when he reaches this area, so I set the collider as a trigger and, I used the OnTriggerStay2d function in my code! ...
1
vote
1answer
37 views

Teleport Not Working in Unity 2D

So I'm basically trying to get my character to "use" a set of stairs by teleporting from one stairway door to another. Each stairway door will be paired with one other stairway door. Here's the code, ...
0
votes
0answers
45 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 ...
1
vote
1answer
155 views

Changing CharacterController's height causes jittering issue in Unity

As title said changing height of Character Controller causes jittering issue. For example when I reduced the height of CharacterController, it seems CharacterController was floating at each frame and ...
0
votes
1answer
39 views

How can I determine when colliders of two gameobjects touch one another?

I stop gameobjects from colliding with one another by having box colliders around the gameobjects with dimensions bigger than the gameobjects. It works fine, but I want that when the gameobjects ...
0
votes
0answers
118 views

Get the convex mesh generated by MeshCollider in Unity

I have a MeshCollider on my GameObject and its convex is set to true. I want to get the convex mesh generated by the MeshCollider and use it for stuff. Currently, ...
1
vote
3answers
226 views

Is it possible to have two trigger zones around the same GameObject in unity?

I have created a trigger zone to make sure that only only gameobject passes through it at a time. The moment the gameobject1 entered the trigger zone, it is given a particular tag but I am not how to ...
1
vote
2answers
326 views

Instantiated object not tracking collision

I have an issue, and I'm not sure why it's happening. I have a prefab that I've built in a colour-changing game. It has the following: Four 2D objects that if they collide with the player (2D ...
0
votes
0answers
75 views

Unity2D - Player Sprite sinking into colliders

Im currently developing a game. At this stage I've got a player controlling a sprite which digs into dirt (30 dirt objects per layer, 3 layers deep). My current issue is that when using A and D to dig ...
0
votes
0answers
152 views

How to convert Transform.position to Rigidbody2D.velocity?

I have an object with Physics Material 2D in Unity (C#). My object rotates in four directions after pressing the left mouse button: -up right -down right -down left -up left After pressing the ...
0
votes
0answers
47 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
15 views

Change 3D collider dynamically

I have created one golf course as mentioned here. When the ball is over the hole, I changed the table's collider to mesh collider. When the ball lefts the hole, I set the table's collider to box ...
0
votes
1answer
1k views

A trigger collider in Unity doesn't allow the player to pass through

It's my understanding that checking "Is Trigger" on a collider should allow rigid bodies to pass through without collision prevention, but my trigger isn't doing that consistently. The player cannot ...
1
vote
2answers
146 views

It lags when it collides. Help? :(

I am trying (and believing) to make a game of pong. I have got a slightly decent working game. I haven't implemented the scoreboard or AI yet because I want the physics to work first. I am trying to ...
0
votes
1answer
33 views

Trouble with assigning a model's own mesh to a mesh collider in Unity

I'm trying to use a mesh collider on the player's avatar, rather than the box collider. I've added the mesh collider to the game object (which also has a rigid body) and selected the "convex" ...
1
vote
1answer
107 views

Is Trigger Colliders not ignored

I am working on a 2D Plattformer with melee attacks. The player is using a Kinematic Rigid Body and a Capsule Collider. Movement (even in slopes), jumping and and collission are working fine. My ...
0
votes
2answers
23 views

how to modify multiples BoxCollider on a same game object?

I have an game object with multiples BoxCollider attached to it, is there a way to get all the BoxCollider to an array so that I could modify their value individually ?
-3
votes
1answer
219 views

Which collider should I use for a bucket?

I have a bucket, and I want a ball to be able to enter it. I'm facing a problem: Unity mesh collider seems not work with concave object... is that true? How can I solve this?
0
votes
2answers
39 views

Unity collision help

So my problem is this: I have a block, which is used as a "pointer block" to show where a block will be spawned. It will be green if it isn't colliding anyone, meaning you can spawn a block. It gets ...
1
vote
1answer
664 views

My collider is not following my humanoid animation: how to do ?

I've a "Zombie" charachter and the following hirearchy: I put a Capsule collider on parent Zombie_01. When I kill the zombie, my "Zombie dead" animation is played, Zombie fall to ground, but the ...
1
vote
1answer
195 views

How to ignore collisions of triggers after first collision of trigger until OnTriggerExit of first collision of trigger?

There is are white and red two teams of tank which are auto spawning in certain time interval. both red and white type of tanks have triggers so when red and white tank come close enough, ...