Skip to main content
DrewAtWork's user avatar
DrewAtWork's user avatar
DrewAtWork's user avatar
DrewAtWork
  • Member for 6 years, 9 months
  • Last seen more than a month ago
awarded
awarded
answered
Loading…
comment
Unity Giving following error : NullReferenceException: Object reference not set to an instance of an object
@Josh I'm guessing you need to tag one of your cameras as 'MainCamera'. Check out Unity's scripting refernce here
Loading…
revised
Unity RectTransformUtility.ScreenPointToLocalPointInRectangle
added more description to the 'Returns' section, and an example function.
Loading…
Loading…
comment
Why does this implementation of aabb-sphere collision ghost collide and how can I fix it
Do you mean "Narrow phase collision detection"? The question you've asked above deals with Narrow phase; how two objects collide, and where they've hit each other. Broad phase is the section that partitions the world to minimize collision checks. There are a lot of different ways to implement broad phase that require some design history of your project to build one that would work best for you. The first link in a google search for "broad phase collision detection" comes up with a rather good article, which has a JS implementation: buildnewgames.com/broad-phase-collision-detection
comment
Why does this implementation of aabb-sphere collision ghost collide and how can I fix it
If you take a look at the locations of the spheres (pos, center, radius) and the aabbs (pos, min, max) that are colliding incorrectly it would probably help you understand where the issues are coming from. It sounds to me like if your not taking the "pos" into account then you may have them all stacked at the worldspace origin (0,0,0).
comment
Why does this implementation of aabb-sphere collision ghost collide and how can I fix it
I don't have a java compiler handy, and I don't know what implementation of Vector3f you're using but I would guess it would look something like: Vector3f worldspace_max = Vector3f.add(pos, max, null); Vector3f worldspace_min = Vector3f.sub(pos, min, null);
comment
Why does this implementation of aabb-sphere collision ghost collide and how can I fix it
@MackybenJonah If you could point me to some documentation on the java Vector3f your using I may be able to help you find a function that works. 'Magnitude' may be called 'Length'. And if there is some sort of 'Scale' function you can scale the vector by 0.5 which is equal to divide by 2. As far as a java OGL library I'm sorry but I don't have any recommendations.
comment
revised
Loading…
Loading…
answered
Loading…
comment
How are the scripts connecting?
@Slagmoth sorry for the delayed reply. It's really up to you how you set up your architecture but I'm generally in favor of Dependency Injection where possible even if Unity makes it difficult sometimes. It looks like the GameManager in this question is a Single Instance, so that's something to consider as well.
awarded
awarded
revised
How are the scripts connecting?
added 1271 characters in body
Loading…
awarded