Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Weird physics?

Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
10-27-2008 12:12
I have not done a lot of work that relies on the physics options. But as I am trying something, I am seeing what I think is weird behavior.

I have written a script such that on touch, an object becomes physical and is supposed to move a specified distance. Upon reaching that target, it should send out a message which causes another prim to move.

Here is what happens. I turn off all rotations, set physics, make the object hover slightly, then llMoveToTarget. I also set llTarget to that same point. When I touch the prim, it moves partway then stops. If I rt-click to edit the prim, then close the edit window, *then* it moves the rest of the distance, hits the target, and sends info to the other prim.

Is this the expected behavior? Am I doing something wrong? Is there a way to overcome this?

The object does not have to be physical, but I need to be able to control the speed and want the movement to look smooth. Any other ideas would be welcome.

Thanks,
Baron
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
10-27-2008 13:01
From: Baron Hauptmann
I also set llTarget to that same point. When I touch the prim, it moves partway then stops. If I rt-click to edit the prim, then close the edit window, *then* it moves the rest of the distance, hits the target, and sends info to the other prim.
Running out of energy? How big is the prim? How far is it moving?
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
10-27-2008 13:03
The prim is a standard plywood cube, moving it 5m.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-27-2008 13:08
well llMoveToTarget slows as it nears it's destination. i'm working on a "patrol" script and i read somewhere about the vector you feed to llMoveToTarget should be a little bit further than the vector fed to llTarget so that it keeps up the speed (this was mention on a thread involving a cart on a track i believe). i guess if it was notecard configured it would be easy enough, but i'm not sure how you would do it if you were to create a list within the script on the fly
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
10-27-2008 13:28
From: Ruthven Willenov
...i read somewhere about the vector you feed to llMoveToTarget should be a little bit further than the vector fed to llTarget so that it keeps up the speed...

Yepyep.

Beware of http://jira.secondlife.com/browse/SVC-2441 when doing that, though. If you're targetting a lower height and you're moving slowly, you can miss your waypoint. I think the problem is that they apply gravity incorrectly in some cases which causes objects moving downwards to move in sortofa hockey-stick path instead of a straight line.

You can (should!!!) also do a vote for http://jira.secondlife.com/browse/SVC-1479, which asks for a llMoveToTarget-like function but with more damping controls.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left