Jump to content

Barry Moody

Resident
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks a heap! That simplified the code a lot and does exactly what I needed!
  2. I'm working on a script in a set of linked prims that rotates a child prim 180 degress around the z-axis when the root prim is touched. This is so a user can view the front and back of an item on display. A message is sent from the root prim to the first child prim in the link set An if/else statement checks which way the prim is "facing" ("front" or "back" views) and swaps between two vector values according to which way it is currently facing: vector front = <0.0, 180.0, 0.0>; vector back = <180.0, 0.0, 0.0>; vector facing = front; default { state_entry() { } link_message(integer sender_num, integer num, string msg, key id) { llSay(0, msg); if(facing == front) { llSay(0, "Show Back"); facing = back; }else{ llSay(0, "Show Front"); facing = front; } vector rads = facing * DEG_TO_RAD; rotation rot = llEuler2Rot(rads); llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROTATION, rot]); } }The first touch (rotate from "front" view to "back" view) works fine as it rotates the prim clockwise. When the prim is touched again, (rotate from "back" view to "front" view) it rotates back to its original position, but does so in a counter-clockwise direction. Is there a way to force the second touch to rotate the prim clockwise like the first touch? Is llSetLinkPrimitveParams the rifght function to do this with? Please be patient with the above code, this is my first script in three years.
×
×
  • Create New...