| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Y-Position Stabilization

Page history last edited by aodendaal 11 years, 11 months ago

Y-POSITION STABILIZATION

by Vorus

 

This is a code snippet that must be added to a mission script.

 

"Here's a tiny little thing I made for use in a giant asteroid field that I created to have a 3D aspect by making some of the asteroids have positive or negative Y values"..."That will keep the player ship from sliding "up" and "down" when they bump into asteroids"

 

<event> 

<if_variable name="yReset" comparator="!=" value="1"/> 

<set_object_property name="player" property="positionY" value="0"/> 

<set_timer name="yTimer" seconds="0.2"/> 

<set_variable name="yReset" value="1"/> 

</event> 

 

<event> 

<if_timer_finished name="yTimer"/> 

<set_variable name="yReset" value="0"/> 

</event>

 

 

 

Comments (1)

Hissatsu said

at 4:33 pm on May 20, 2012

Float doesnt work for timers. If timer is set to a float value, it is truncated - meaning, for example, that a timer of 0.2 seconds is equal to setting variable, since it will be finished a soon as its set. Therefore, in this example, setting Y happens not five times per second, but each tick.

You don't have permission to comment on this page.