Disable component on collider object when leaving overlapsphere
So, I have a non allocated overlapsphere in front of my character. I use it to find interactable objects in the scene. I also enable an outline component on the colliding object to show which object is...
View ArticleDisable component on collider object when leaving overlapsphere
So, I have a non allocated overlapsphere in front of my character. I use it to find interactable objects in the scene. I also enable an outline component on the colliding object to show which object is...
View ArticleHow to calculate normal when using OverlapSphereNonAlloc for collision...
Hello everybody, I use [OverlapSphereNonAlloc][1] to detect collision of my player with wall/s in the scene. Once the collision detected I want to calculate the normal, similarly to...
View ArticleOverlapsphere not working multiple times
Hi there, a little new to this but I've been having an issue with the overlapsphere code I'm trying to use to pick up objects in my game. using System.Collections; using System.Collections.Generic;...
View Article[Solved] Detecting objects with OverlapSphere within the frame they are created?
Hey, I’ve been trying to procedurally generate several "road segments“ with obstacles at random positions on top of the segments. This has to be done when the scene loads. So my approach was, to solve...
View ArticleRaycastAll in all directions on one axis?
I'm working on a grid-based game and I'm using the below code to check possible movement squares Collider[] sphereCast; sphereCast = Physics.OverlapSphere(raycaster.transform.position, walkDistance,...
View ArticleHow do I get the layer of an object
Im trying to find the layer of a gameobject through a collision with Physics.OverlapSphere, how would I do that?
View ArticleDetect object outside overlapSphere
Hey guys, I'm asking me how I can detect, if the Enemy is outside the overlapSphere range to do some stuff. How can I do that? objectinzone = Physics.OverlapSphere(this.transform.position, 100f);...
View ArticleOverlapSphere Detecting Colliders Outside of Range (Pooled Objects)
I have a pool of 10 enemy objects that get spawned from one of 3 random locations around a central point. I have towers which target the incoming enemies using OverlapSphere. I'm not using a layer mask...
View Article2D Area of Effect Script - OverlapCircle not working
I meant to loop through all the colliders inside the range of this overlapCircle and do something (EnemyDeath) if the colliding objects meet some specific requirements (have a script attached). However...
View ArticlePhysics.OverlapSphere not returning colliders.
All my objects have boxColliders, and the proper script, yet the OverlapSphere isn't returning any colliders or objects AT ALL. Why? I've been searching for an answer for 2 days.
View Articlewhat is my mistake HELP!
Hi great codder firstly sory for my bad english. So ı wrote this cod for my player enable to jump only his child emty object touch the ground layer mask public void isGrounded() { Collider[] collider =...
View ArticlePhysics.OverLapSphere is not working Please help me to fix it or replace it
if( Physics.OverLapSphere(groundCheckTransform.position,0.1f,playerMask).length==0 ) { RotateByDegrees(); }
View ArticlePhysics.OverLapSphere is not working Please help me to fix it or replace it
if (Physics.OverLapSphere(groundCheckTransform.position, 0.1f).length == 0) { RotateByDegrees(); }
View ArticleWhy do Physics2D NonAlloc functions get deprecated?
Hello Community, - at the moment, I am refactoring a 2D project. When I wanted to change the function `Physics2D.OverlapCircleAll` to `Physics2D.OverlapCircleAllNonAlloc` I noticed, that all static 2D...
View ArticleOverlapCircleAll, layerMask ( Problem)
Hi, this is my code, if(targetFood == null) { Collider2D[] allFood = Physics2D.OverlapCircleAll(antPosition, viewRadius, 7); if(allFood.Length > 0) { Debug.Log("Find Food"); //Select one food...
View ArticleOverlapSphere missing colliders
I'm trying to create a batch of trees which I create by finding a random position inside the area and then checking with Physics.OverlapSphere that two tree are not too close to each other. Vector3 pos...
View ArticleEfficient way to scan surrounding with large number of objects
Hello, I am working on a personal ant colony simulation project and I am struggling with performance. I have a bunch of agents (ants) in the scene and I need each of them individually to scan their...
View ArticleHow to make a Shmup Graze mechanic
I'm making a bullet hell and I really wanna add a graze mechanic, however I can't figure out how to make the script only graze bullets once per bullet. I'm using Physics.OverlapSphere to get a list of...
View ArticleReplacing OverlapSphere with colliders (Detecting weapon collision with...
So i basically have this really basic combat system that i made off Brackeys' tutorials...but now i want it to be more complex and involve colliders instead of Physics.OverlapSphere(). So i just need...
View Article