Vitus
Resource contributor
- Messages
- 1,480
- Country
Hello friends,
I have this wee problem with one of my custom animations. Consider this animation:
This is the little upwards-swinging door behind the pilot. The idea is that You can click and drag the door open. If you release the mouse button when the top position (>99) is reached, it locks in place, otherwise it comes back down. The thing is that the animation doesn't show up in the interior cockpit. I can interact with the door with the mouse (click&drag), but nothing happens. I have the same script attached to the door in the exterior model and when I click and drag it in the interior model, the open-state shows up in the exterior model.
Any clues what the problem might be?
I have this wee problem with one of my custom animations. Consider this animation:
Code:
<PartInfo>
<Name>door_cp</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:DOOR CP HOLD,bool) 0 ==
if{
(L:DOOR CP GOAL,number) (L:DOOR CP POSITION,number) - 0.1 *
(L:DOOR CP POSITION,number) + 0 max (>L:DOOR CP POSITION,number)
}
(L:DOOR CP POSITION,number)
</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle+LeftDrag+LeftRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{
(M:Y) (>L:MOUSEPOSY,number)
1 (>L:DOOR CP HOLD,bool)
quit
}
(M:Event) 'LeftDrag' scmp 0 ==
if{
(M:Y) (L:MOUSEPOSY,number) - (>L:MOUSEPOSDELTA,number)
(M:Y) (>L:MOUSEPOSY,number)
(L:DOOR CP POSITION,number) (L:MOUSEPOSDELTA,number) 0.5 * - 0 max 100 min (>L:DOOR CP POSITION,number)
}
(M:Event) 'LeftRelease' scmp 0 ==
if{
0 (>L:DOOR CP HOLD,bool)
(L:DOOR CP POSITION,number) 99 <
if{
0 (>L:DOOR CP GOAL,number)
}
els{
100 (>L:DOOR CP GOAL)
}
}
</CallbackCode>
<TooltipText>
</TooltipText>
</MouseRect>
</PartInfo>
This is the little upwards-swinging door behind the pilot. The idea is that You can click and drag the door open. If you release the mouse button when the top position (>99) is reached, it locks in place, otherwise it comes back down. The thing is that the animation doesn't show up in the interior cockpit. I can interact with the door with the mouse (click&drag), but nothing happens. I have the same script attached to the door in the exterior model and when I click and drag it in the interior model, the open-state shows up in the exterior model.
Any clues what the problem might be?