The Daily Click ::. Forums ::. Klik Coding Help ::. setting child object's position relative to a parent object
 

Post Reply  Post Oekaki 
 

Posted By Message

DerbiaN



Registered
  27/03/2003
Points
  512
18th June, 2003 at 12:37:48 -

Now I know that this can be done by using "always - set position relative to parent 4,16 (located)", but this method does not seem to be very accurate in some cases. Another problem is that you can't use expression evaluator to choose any values in it. Does anyone know how to do this by just using some calculations of the angles etc.? I already got it partially working by doing the following:

Always: Set "X Pos of child" to [ "X Pos Parent" + ( Sin(Angle of parent)) * 100.0 ]Always: Set "Y Pos of child" to [ "X Pos Parent" + ( Cos(Angle of parent)) * 100.0 ]

The problem in this is that the child always goes straight in front of the parent, the range being 100 in this case. If I try to change either of the range values, it starts rotating like an ellipse.

One example where one would need this would be when a character has a gun on his right arm as a separate object, and this object needs to stay attached at the same spot on his hand when he turns to different directions.


 
n/a

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
22nd June, 2003 at 00:17:22 -

Are you talking about the lag experienced when you have one object "always" setting it's position relative to another? If so, (first of all that was a rather round-about way of telling us the problem) and secondly, you can fix this by having an invisible object that the player moves (rather than the character) and set the position of the character and the gun both relative to the position of the invisible object. That way they will both experience the same lag (and hence always appear together).

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert
   

Post Reply



 



Advertisement

Worth A Click