Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control an automatic action's variables form a button

Status
Not open for further replies.

Gameleo

Technical User
Jul 18, 2004
4
0
0
IT
Hi!

I need to control the Rotationspeed of the AutomaticModelRotation from a button.
Anyone know how?

thnks

Gameleo
 
Say you have a 3D member in Sprite(1) with Automatic Model Rotation behaviour (from the Library) attached. You can access and modify the speed of the rotation using:
--
sprite(1).scriptInstanceList[1].pSpeed
--
 
Thanks! :)

Can you tell me in quick details how to use it?


Gameleo
 
The following button script will increase the rotation speed of sprite(1) by 1 on every mouse click. The max speed is set to 10.
--
on mouseUp me
tSpeed = sprite(1).scriptInstanceList[1].pSpeed
if tSpeed < 10 then
tSpeed = tSpeed + 1
sprite(1).scriptInstanceList[1].pSpeed = tSpeed
end if
end mouseUp
--
 
Great!
but property not found #pSpeed

why?
 
Do this test. Start the movie (the movie has to be running), and then type in the Message window:
--
put sprite(1).scriptInstanceList
--

You should get the answer something like:
-- [<offspring "Automatic Model Rotation" 1 2460dc>]

If so, then type in:
--
put sprite(1).scriptInstanceList[1].pSpeed
--

You should get the value of pSpeed (the rotation speed).

Let me know the outcome of this test.
 
Wow!

It works now!!!

Thank you very much!

may be before I did some error....

Tnks again.

Gameleo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top