Mouse Collision Detection Problem when sharing mouse cursor component in 3 diferent scenes
by Patryck Pabllo · in Torque X 2D · 02/22/2010 (9:15 pm) · 0 replies
Dear Friends,
I´m having a mistake while using mouse cursor to select options in my project, and need help from a super dude to solve it.
Let me discribe it:
This project has 3 scenes. The first scene is the main menu, the second is a middle scene with some interactivity,
and the third is the game. The way of interactivity on both of them is through the mouse.
To use the mouse as input way, I´ve created a mouse component. It works fine in the first and third scenes,
navigating from main menu to the second scene, and doing actions on the third scene. But in the second scene,
I can do nothing to interact, because the collision detection doesn´t work. I got the same way on both of scenes
to solve collisions, using TXBuilder interface to determine what should happen when some object in the
scene collides with mouse cursor object (in my case a little hand). But the delegate T2DCollisionComponent.OnCollision, in the second scene,
is not been called.
Trying to discover what is happening, I changed the way to get input in the
second scene. I removed my mousecomponent and added native MovementComponent to the mouse cursor object. By this way, the collision detection in the second scene works. So, now, my project looks like a Frankstain, because in the first scene player uses mouse, in the second one he uses keyboard when he is thinking it should
be mouse, and in third one he comes back to use mouse.
I really don´t know what is happening and really need help from you. Thanks for the time spent.
I´m having a mistake while using mouse cursor to select options in my project, and need help from a super dude to solve it.
Let me discribe it:
This project has 3 scenes. The first scene is the main menu, the second is a middle scene with some interactivity,
and the third is the game. The way of interactivity on both of them is through the mouse.
To use the mouse as input way, I´ve created a mouse component. It works fine in the first and third scenes,
navigating from main menu to the second scene, and doing actions on the third scene. But in the second scene,
I can do nothing to interact, because the collision detection doesn´t work. I got the same way on both of scenes
to solve collisions, using TXBuilder interface to determine what should happen when some object in the
scene collides with mouse cursor object (in my case a little hand). But the delegate T2DCollisionComponent.OnCollision, in the second scene,
is not been called.
Trying to discover what is happening, I changed the way to get input in the
second scene. I removed my mousecomponent and added native MovementComponent to the mouse cursor object. By this way, the collision detection in the second scene works. So, now, my project looks like a Frankstain, because in the first scene player uses mouse, in the second one he uses keyboard when he is thinking it should
be mouse, and in third one he comes back to use mouse.
I really don´t know what is happening and really need help from you. Thanks for the time spent.