I have multiple GameObjects in my Scene.
There is some Package, player need to collect this. BoxCollider2D is attached to them. Here is the configuration :
Here is the player's configuration:
Another configuration of player:
Intentionally placed to Collider, so one can detect body touch and another fall over head of package.
And there is also a walkway. Here is the configuration :
Every RigidBody2D has Continues collision detection.
Still it creates problem, first everything is cool as it should be. Later Player stops colliding but collides sometimes. Why is that ?
What can be the probable cause?
Here is scene-view :
Here is some shots :
https://drive.google.com/file/d/1DoWSG0hlZZb0KIX-oUWI8FPXK5HepppY/view?usp=sharing
Big File for Stack Overflow - 35MB
Here is the project : https://github.com/maifeeulasad/Slicer2D-Unity
Related
hi i was making a multiplayer game where at some point the bullet was colliding with the sender and i don't want that. It keeps making glitches and the bullet keeps floating. I even tried reducing the player box collider but its still getting stuck. if i disable collision detection for the player and the bullet, the multiplayer version will be affected and players won't be dying
Please help
tried to reduce the player collider but when the bullet is shot on y axis its getting stuck
Since you're doing a multiplayer game, On the client side you could change the player's object layer to something unique. In my case here, I've added a new layer called Player and I'm instantiating my player on a layer called Enemy by default. I'm also putting my bullets on a layer called Bullet.
Make sure you only change the layer from Enemy to Player on the client side at runtime and for your client's player object only.
Then you can go into Edit/Project Settings/Physics and scroll down to the bottom until you find a collision truth table.
Then ensure that you uncheck the collisions between your player's layer and bullet's layer.
I'm having some interesting behaviour with NavMeshAgents. So I've been working on a project for the past few months which is revolving around creating believable enemy AI systems for stealth games. When the player kills an enemy they can pickup the body and put it into a body bag, this all worked well and fine for a while but now once the player has picked up two corpses all Nav Agents do this.
They are still in their patrol state (using a behaviour tree) and all of the AI have a destination set which can be seen on the debug tools for the Agent. However if I try to move the AI whether that being dragging them around or setting a position through the inspector they will snap back to a corner of the NavMeshSurface.
Using Unity 2021.1.17f1 and using the latest compatible version of the NavMeshComponents package provided by Unity.
Things I've tried:
Changing Radius and Height of agents
Setting the floor and such as navigation static objects
Removing the NavMeshComponents package scripts and replacing them with the original NavMesh system. Didn't work and took a lot longer to build the NavMesh
Interesting behaviour:
The amount of body bags the player has to pick up seems to be related to how many AI are in the scene. For example currently there are 23 AI and it takes two body bags for this glitch to happen, but if there are 24 to 31 AI in the scene then it requires three body bags to be picked up for it to happen.
All calls to the NavMeshAgent are done through a AILocomotion script which handles enabling and disabling rotation, movement and updating the animation. Movement is only disabled upon death or when the AI is in the wait state, other than that every Move based state re-eneables movement.
Update: Found the solution
It turns out Unity does not like it when you destroy a NavMeshAgent component during runtime. Now when the player picks up a corpse it leaves the NavAgent behind but destroys the mesh and colliders etc.
I am new to this and my game consist of a wide cube and a ball, the ball rolls on the cube platform like a ball in maze game. the ball drops trough the platform when i tilt to fast.(not that fast even). i tried multiple settings on the rigid body component and nothing worked. any pointers?
Might be wrong but from what I know when solving collisions Unity assumes everything has RigidBody or doesn't move, I assume only a ball in your project has rigidbody, but both ball and cube can have their position/rotation changed from script so what I suggest is to attach rigidbody to the cube and set it to kinematic so it won't move on its own and then move it via RigidBody.MoveRotation method to make sure collision is detected.
I'm currently developing a game with unity3d (2019.3 version).
My problem actually, is that I don't know how to make two colliders don't collide with each other, but still be able to interact.
Okay, let's have an example.
Let's say that I have a zombie and a player, I want the player going through the zombie, but i want the collider of the player able of being detected by the one on the zombie, so the the zombie can attack the player, same for the bullets that the player shoot on the player. (little precision, the zombie attack the player thanks to a trigger collider in front of him).
I've already tried to modify things in the layer collision matrix, but the player and zombie aren't able to interact. So that's not good.
If you want the colliders to detect eachother but not collide then you should probably set one of the colliders to be a trigger.
Just check the Is Trigger checkbox and that should help you achieve the desired result.
I am currently working in a Unity 3D project (in version 5.0.1 to be precise) in which the character can walk in different-shaped planets without falling. So it is always attracted by the planets gravity (similar mechanic to the Super Mario Galaxy games).
Now, the problem is when I try to code the AI for the enemies. This AI should be pretty much simple, but because of this thing that I have with the planets shapes, I haven't been able to come up with a solution. The enemy should check where the player is and move ahead to its position. It's a really dumb enemy. But the thing is, that the enemy must be able to track the player and get to its position no matter what planet he is in. So, if the planet is circular, I cannot make the enemy look at the player and then move forward, as I would do in a plane planet.
I have already tried using a NavMesh, but Unity doesn't want to collaborate and ends up making a NavMesh of 1/3 of the planet. I don't understand why. I have tried changing every single parameter of the NavMesh baking but I haven't succeeded.
Another problem that I would like to do is: ¿How would you make a player be able to walk on the surface of any planet, no matter what its shape, in a smooth way while using a Mesh Collider? I am currently achieving this by getting the planet's normal with a raycast, rotating the player so that the Y axis is perpendicular to the normal and applying a force in -Y to simulate gravity. But this brings lots of problems when I implement the Mesh Collider. It results in a jittery effect. But, when I use a primitive collider from Unity, it works fine...
Anyway. What I need the most now is the answer to the AI question. The other one is kinda like a plus.
P.S: It doesn't matter if the solution is in Javascript. I can then translate it to C# :)