Mounting Scrollers to SceneObjects
by C Martin · in Torque Game Builder · 10/07/2008 (4:36 am) · 3 replies
Hi Guys,
I need to mount a scroller between two moving sprites, and I need to do this through script. So i've been trying a few things out - aaand not having much luck. There are a number of issues i'm running into:
1. I can call mount on the sprite object and attach the scroller to it, but it always attaches it to the middle of the scroller. I've set two mount points in TGB - but can't find a way to specify which of the two mount points on the scroller the sprite should attach to
2. When I mount the scroller to the sprite, the sprite moves to the scroller, I can't get the scroller to attach to the sprite and move with the sprite
Thanks - any help at all would be appreciated!
Cheers :)
Edit: Removed question regarding mount being called on scroller - that was a script issue
I need to mount a scroller between two moving sprites, and I need to do this through script. So i've been trying a few things out - aaand not having much luck. There are a number of issues i'm running into:
1. I can call mount on the sprite object and attach the scroller to it, but it always attaches it to the middle of the scroller. I've set two mount points in TGB - but can't find a way to specify which of the two mount points on the scroller the sprite should attach to
2. When I mount the scroller to the sprite, the sprite moves to the scroller, I can't get the scroller to attach to the sprite and move with the sprite
Thanks - any help at all would be appreciated!
Cheers :)
Edit: Removed question regarding mount being called on scroller - that was a script issue
About the author
Torque Owner Deozaan
For #1, something like this ought to work for you:
The 0s and 1s after the %linkID should be changed according to your needs, according to what you want from the following options:
mountToLinkpoint(t2dSceneObject object, int linkpointID,[float mountForce=0],[bool trackRotation?=true], [bool sendToMount?=true],[bool ownedByMount?=true],[bool inheritAttributes?=true])For #2, I'm not sure why you can't get the scroller to move to the sprite. If you set sendToMount to true, it ought to do it.