How to write the object position itself into position script controller
Hi ...
I'm curious about the expression script because I rarely use it, only once in a while ...
such a simple case :
dist = ( distance $.pos $sphere001.pos ) $.pos.z += dist
my question is :
how to write '$.pos' itself into expression of postion script controller ?
thanks
Attachment | Size |
---|---|
positionscript_controller_failed.jpg | 193.83 KB |
Comments
...
Try this one
bga
hi barigazy, thank you .. its
hi barigazy, thank you .. its working correctly :)
but I'm still confused about expression script.
I saw some scripts from the other scriptor its same/closest case.
if some user deleting the target object is will getting error (some problem)
mm .. so I'm looking for to fixing that's error
a snippet method, such as:
if isValidNode trgObj then (distance trgObj.pos fixPos) else fixPos.z
it's working but it's making move the object(tea) to zero z position,
as I want the object(tea) position do not impact anything when the target has been deleted.
z position should stay on current z position.
any suggestion ?
...
Create one more Constant "fixTrgPos" which will represent starting target position
like I did for source object
bga
nicely :)I did what you
nicely :)
I did what you said...
but it's almost close to the goal.
with your method it works if the target(sphere) has not moved.
but when the target has been moved and the user deletes the target then the source(teapot) position still moving to another place.
I need the source position must be in the same place when the target erased, at any time in which the target has moved or not.
thank you again barigazy
regards