Rhemah Posted April 27, 2015 Share Posted April 27, 2015 // BallScriptinteger pushme = 0; default { state_entry() { llListen(0,"",NULL_KEY, ""); } listen(integer chan, string num, key id,string msg) { if(msg == "pushball") { pushme = 1; llSensor("", NULL_KEY, AGENT, 2.5, PI); } } sensor(integer total_number) { if(pushme){ vector pos = llGetPos(); vector offset = <0,0,0>; pos+=offset; llMoveToTarget(pos,0.3); pushme = 0; llSleep(0.5); llStopMoveToTarget();} } }Hello, im trying to make a ball that will be pushed away via command from an agent near it; however, i made it reversed and i can't figure out how to make the object be pushed away.all i wanted to happen is it will be like a reverse magnet, instead of being attracted from the agent it will draw away itself from the agent on command.i tried tweaking the vector offset to <5,5,5> but the direction is always the same. I want to create something like the agent is kicking the ball forward. a little help pls :matte-motes-crying: Link to comment Share on other sites More sharing options...
Dora Gustafson Posted April 27, 2015 Share Posted April 27, 2015 Make the offset the vector between you and the object:vector offset = llGetPos()-llDetectedPos(0);pos += offset; In one step:pos = 2.0*llGetPos()-llDetectedPos(0); :smileysurprised::smileyvery-happy: 1 Link to comment Share on other sites More sharing options...
Rhemah Posted April 27, 2015 Author Share Posted April 27, 2015 Thank you Dora!:matte-motes-big-grin-squint::smileyvery-happy: Link to comment Share on other sites More sharing options...
Recommended Posts
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