Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   delay reaction script (https://simplymaya.com/forum/showthread.php?t=9802)

strytus 13-01-2004 08:31 PM

delay reaction script
 
Hey guys, i'm trying to make a delayed reaction and was hoping a script would justify it. I have looked on the sticky thread and found it to be of good use, but after that i'm stuck. (i'm not a scripter of any sort) Basically i'm using this script for a halo right above my angels head.


I used the:
Attribute of an object at a certain “offset"

int $offset = 10;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime - $offset;
$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;
pSphere1.translateZ = $cube1Zpos;

this works well for the only translate Z axis, then i've tried to duplicate it throughout the Y and X axis, but i get a syntax error
here's the modified version of it

int $offset = 10;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime - $offset;

$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;
$cube1Ypos = `getAttr -t $offsetTime pCube1.ty`;
$cube1Xpos = `getAttr -t $offsetTime pCube1.tx`;

pSphere1.translateZ = $cube1Zpos;
pSphere1.translateY = $cube1Ypos;
pSphere1.translateX = $cube1Xpos;

any suggestions on how to fix this or get it to work correctly

thanks in advance

Alan 20-01-2004 06:50 PM

I think you may need to use setAttr rather than saying pSphere1.translateX.

so
setAttr pShere1.tx $cube1Xpos;
setAttr pShere1.ty $cube1Ypos;
setAttr pShere1.tz $cube1Zpos;

try that, is this an expression or a script? cause that will make a difference to your syntax.

Post again if you need more help

Alan

strarup 21-01-2004 09:43 AM

Hi strytus,

maybe you can use some of this from this tutorial by Swanimator... "Time offset Expression"... -->
http://www.swanimator.com/tipstutori...Expression.htm

regards

Strarup

strytus 24-01-2004 06:37 AM

Thanks strarup

but what's the difference between the scripted i typed in and the one that's on the link???? is it only because I done mine is Z, Y, X order instead of the XYZ order?


All times are GMT. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018