Jump to content
  • 0

Split an object into multiple


naughtyniece
 Share

You are about to reply to a thread that has been inactive for 3101 days.

Please take a moment to consider if this thread is worth bumping.

Question

Hi,

I created an advent calendar but to do this i had to have 24 objects and a script in each one to deliver a gift etc.

It works and is fine, but i cant ehlp thinking that maybe i could make a less prim heavy version, if i could identify

where on an object someone clicks or splitting one object into multiple parts?

Hope thats clear, i want one prim that can be clicked in multiple places or a similar solution?

 

thamks and merry xmas

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Yes, you could have done the whole thing with one prim.  The llDetectedTouchST function in LSL lets you find out exactly where a person clicked on a prim's face.  So, you can map the texture that you are using for your calendar and then tell easily whether someone clicked in the area that's outlined by Day One or Day Two  or whatever.

touch_start(integer num){    vector Where = llDetectedTouchST(0);    if (Where.x > 0.1 && Where.x < 0.2 && Where.y > 0.1 && Where.y < 0.2)    {        llSay(0,"Someone clicked in the area with 0.1 < X < 0.2 and 0.1 < Y < 0.2 !");    }    //  And so forth}

You can of course nest the if tests to make the script most efficient since you are testing for 24 different areas, but that's the general idea.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3101 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...