Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question spherecast but with scale not direction?

Discussion in 'Physics' started by theCyberStallion, Apr 27, 2021.

  1. theCyberStallion

    theCyberStallion

    Joined:
    Oct 3, 2020
    Posts:
    29
    is there a way to simulate raycasts going in all directions, like an expanding sphere or something that can also get raycasthit data? i'm making a custom physics engine because i need to recreate minecraft as closely as i can for 100 dollars(dont ask) i don't want to use actual rididbodies because that has WAY too many variables and isnt consistent enough to work for minecrafts physics. i cant use charactercontrollers because minecraft uses AABB'es for colliders. i cant figure out how to resolve collisions without bouncing, friction or any of that stuff, so that they have the ability to be flung into a wall at an angle and keep its velocity just so that it isn't constantly re colliding with the wall, but doesn't just set it all to 0.(like an elytra in creative) Here's what i've tried:

    Sphere casting. upon further inspection of the docs its just moving a sphere along a path AND if it is touching something when it begins it doesn't count, and since it has a fixed radius it wont work.

    Box casting. same as sphere casting.

    OnCollisionEnter. as i said earlier my method of movement wont work well with rigidbodies, and it requires one, and it must be non kinematic so i might as well just not code this, which wont work.

    OnTriggerEnter. doesn't even return hitdata in the first place.

    Manual Raycasting. isn't accurate enough, my engine needs to find the normal of slim objects such as carpets, or end rods

    Actual rigidbodies. again, i'm using measurements from minecraft so i need PERFECT acceleration, decelleration, speed, velocity etc., and through my testing consisting of setting velocity directly, addforce, transform, kinematic move position, regular movepos, etc, it doesn't comply with minecraft's physics.
     
    Last edited: Apr 27, 2021