Giter Site home page Giter Site logo

Comments (2)

DavidArayan avatar DavidArayan commented on June 24, 2024

Hello DrBretto,

Sounds like a weird projection error. Keep in mind that the Plane has a special math property in that it extends indefinitely in its axis. It's basically defined via a position and orientation (facing direction vector) in 3D space.

Make sure your initial collision detection against the object you're cutting is actually passing correctly. Also make sure the cutting plane is actually initialising correctly, maybe debug-render it in its own coordinate frame to make sure?

Also, that NullReferenceException is weird, perhaps something is happening on the object that you're cutting before the cutter has executed? Could you stack-trace it and see whats happening?

from ezy-slice.

DrBretto avatar DrBretto commented on June 24, 2024

Hello, and thank you for responding!

Bear with me, I am new to this :)

I have made some progress here. First, I have better luck running this in a FixedUpdate rather than Update. This allowed me to keep triggering the slice until it works on each slice attempt by adding the isTouched=true to the onTriggerStay function as a backup. Because it makes multiple attempts now, it slices just about every time. This is good enough for my purposes, but this is a band-aid. It's still "skipping" randomly and still giving the error message.

I can identify the object that's missing. It happens right when it calls the function that does this:

return obj.Slice(transform.position, transform.up, crossSectionMaterial);

And the next line tries to reference the object that returns., that triggers the error.

I was not able to find the actual Slice method in the files for some reason. It is important to note that when I take the trigger out of OnTriggerStay and just OnTriggerEnter, it might be that it's still working most of the time, but occasionally there's a noticeable delay. It may be working every time, but perhaps sometimes just takes too long to pop up? It's hard to tell.

The objects being sliced are cubes and their only behavior is that they steadily move towards the player. The collisions are being detected reliably, I have the haptic triggers and score updates in the same OnTriggerEnter function (and OnTriggerStay for the haptics as well).

I do not know how to do a stack trace, or what that is :) I am flyin' by the seat of my pants. If you still want me to do so, I can look into it.

from ezy-slice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.