3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Look Script For Cutouts

Step 1Add Script

Right click on your cut out and choose edit from the pie menu.

Go to the contents tab in the edit menu and click on "New Script."
Open the new script and replace its contents with the following code:
Open the cut-out contents from the edit menu and click on the add script button.
Open the new script.
Paste the following code into the window, replacing the current contents:

//Simple Rotation Script to give your Bartender a little life
//If this script is set to run, it will turn to face the nearest agent.
//Modify to fit your bartender.
//Based off of scripts by Ope Rand & Christopher Omega
// AXIS_* constants, represent the unit vector 1 unit on the specified axis.
vector AXIS_UP = <0,0,1>;
vector AXIS_LEFT = <0,1,0>;
vector AXIS_FWD = <1,0,0>;

rotation getRotToPointAxisAt(vector axis, vector target) {
return llGetRot() * llRotBetween(axis * llGetRot(), target - llGetPos());
}

// Strength and damping are values used to control how llRotLookAt and llLookAt move, these values are tunable.
float strength = 1.0;
float damping = 0.250;

default {
state_entry() {

//Stops it from tipping over
llSetStatus(STATUS_ROTATE_X, FALSE);
llSetStatus(STATUS_ROTATE_Y, FALSE);
llSetStatus(STATUS_ROTATE_Z, TRUE);

//llSensorRepeat(string name, key id, integer type, float range, float arc, float rate)
llSensorRepeat("",NULL_KEY,AGENT,10,PI,1); //set the last three variables lower/higher to lessen lag
}
sensor(integer num_detected) {
vector target = llDetectedPos(0);

// This line points the fwd (X) axis at the target:
llRotLookAt(getRotToPointAxisAt(AXIS_FWD, target), strength, damping);

// This line points the left (Y) axis at the target:
// llRotLookAt(getRotToPointAxisAt(AXIS_LEFT, target), strength, damping);
// This points the up (Z) axis at the target:
// llRotLookAt(getRotToPointAxisAt(AXIS_UP, target), strength, damping);
}
}
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
2
Author:Aster