- Home /
Note Pad not flipping back
I essentially have a deck of cards that are on a spiral binder. Much like a spiral note pad. Each card has its own collider (I have also tried mesh colliders). When clicked on, each animates over the spiral binding, flipping on its face, just like a spiral note pad would. All good. When the back side of the top most flipped card is clicked on it animates back and my code is bringing all the other flipped cards as well. All good.
But ... this only works if I am directly over the flipped cards. If I have a truly orthogonal view (straight down) of the flipped deck. I cannot seem to engage the colliders from an angle. This is not going to work for this simulation. Thoughts?
Answer by diggerjohn · Mar 14, 2014 at 07:10 PM
Solved the silly problem finally. I had moved a wall collider just about completely over an object collider so I was not able to hit the object. Found some very useful code in another thread from last year. This is what clued me in to the dumb mistake I was chasing my tail over ...
void Update(){ if (Input.GetMouseButtonDown (0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { Debug.Log ("Name = " + hit.collider.name); Debug.Log ("Tag = " + hit.collider.tag); Debug.Log ("Hit Point = " + hit.point); Debug.Log ("Object position = " + hit.collider.gameObject.transform.position); Debug.Log ("--------------"); } }
Life is good again and perfect, it is a Friday.
Your answer
Follow this Question
Related Questions
Colliders, Mesh or Box? 1 Answer
why mesh collider penetrate box collider? 3 Answers
Mesh.CombineMeshes - what happens to colliders? 0 Answers
Mesh collider not working as expected 2 Answers