playMaker

Author Topic: How to make list game objects inside collider more consistent?  (Read 1374 times)

paradiseprime

  • Full Member
  • ***
  • Posts: 105
When the framerate is low, collisions start acting up and not working. Hell, even with a solid frame rate it still doesnt always detect collisions. If I go frame by frame it will detect every time obviously. I am using a Box Collider because any other collider doesnt work for whatever reason. [Would love a fix for that too].


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: How to make list game objects inside collider more consistent?
« Reply #1 on: March 05, 2020, 05:31:29 AM »
Hi.
on rigidbody(2d) set Collision Detection to 'Continuous'
and Sleeping mode to 'Never Sleep'

paradiseprime

  • Full Member
  • ***
  • Posts: 105
Re: How to make list game objects inside collider more consistent?
« Reply #2 on: March 05, 2020, 05:52:28 AM »
This is in 3D. I already have a rigid collider on the enemy getting hit unless I need to also put it on the weapon?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: How to make list game objects inside collider more consistent?
« Reply #3 on: March 05, 2020, 08:35:47 AM »
Hi.
For 3D set Collision Detection to 'Continuous' or 'Continuous Dynamic'

if many windows are open/visible while playing you can get a lot of lag from them.
but even when playing fullscreen you can still have lag due to editor.

for performance it is best to test in a build.

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 150
Re: How to make list game objects inside collider more consistent?
« Reply #4 on: March 05, 2020, 01:25:38 PM »
I think 'Continuous Speculative' is what you're looking for, read more here:
https://docs.unity3d.com/Manual/ContinuousCollisionDetection.html

If it's not available in your Unity version: I used to make a raycast before moving the rigidbody, so an raycast from the current position to the new position and only move if it hits something. A bit more work, so the Continuous Speculative defenitly seems like a good option.