Resolved: Mounting Problems
by Deozaan · in Torque Game Builder · 04/06/2008 (7:06 pm) · 2 replies
I'm working on an asteroids-like space game, except you can go beyond the limits of the screen (no world-wrap). One of the things I'm trying to do is have a few arrows point to the nearest asteroids.
First of all I tried mounting the camera to the ship with 0 delay (snap) but it made everything appear too jumpy. So now I have a soft mount to smooth that out.
But now the problem has returned as I try to mount the arrows to the ship so they stay in the same position relative to the ship. The first problem with it is that if I mount with 0 delay, the arrows will no longer rotate to follow the objects they are pointing to. But a soft mount makes the arrow lag too far behind the ship, or if I set the force too high (25) then it goes back to being really jumpy.
Technically these arrows should be part of the GUI, but since the ship doesn't stay in the center of the screen, they can't just be in one static position.
Are there any other solutions I'm not thinking of?
First of all I tried mounting the camera to the ship with 0 delay (snap) but it made everything appear too jumpy. So now I have a soft mount to smooth that out.
But now the problem has returned as I try to mount the arrows to the ship so they stay in the same position relative to the ship. The first problem with it is that if I mount with 0 delay, the arrows will no longer rotate to follow the objects they are pointing to. But a soft mount makes the arrow lag too far behind the ship, or if I set the force too high (25) then it goes back to being really jumpy.
Technically these arrows should be part of the GUI, but since the ship doesn't stay in the center of the screen, they can't just be in one static position.
Are there any other solutions I'm not thinking of?
#2
I was certain I had looked up the documentation for mount before, but I found a good explanation of it with an example in the TGB offline docs.
obj.mount(mountObj, "x y", force, trackRotation, sendToMount, ownedToMount, inheritAttributes);
arrow.mount(ship, "0 0", 0, 0, 1, 1, 1);
The strange thing is that when mounting an object using the TGB Level editor, I would uncheck the trackRotation box but it didn't matter. It was still superglued to the rotation of what it was mounted to.
Anyway, case closed.
04/07/2008 (11:50 pm)
I can't remember what I did but I got objects and the camera to mount (with a force of 0) without jittering now. And to solve my rotation problem I had to set Track Rotation to false;I was certain I had looked up the documentation for mount before, but I found a good explanation of it with an example in the TGB offline docs.
obj.mount(mountObj, "x y", force, trackRotation, sendToMount, ownedToMount, inheritAttributes);
arrow.mount(ship, "0 0", 0, 0, 1, 1, 1);
The strange thing is that when mounting an object using the TGB Level editor, I would uncheck the trackRotation box but it didn't matter. It was still superglued to the rotation of what it was mounted to.
Anyway, case closed.
Torque Owner Deozaan
This can easily be verified by using a plain circle as a graphic, giving it the Circle Collision Detection scheme, and enabling the View Collision Bounds in debug mode. As I drive my little circle around, the collision circle is actually ahead of it, and jumping wildly back and forth, just like anything mounted to it.
But what can I do to smooth it out?