Re:Rilevare la Velocità 

#177685

simo-la leggenda
Partecipante
  • Blenderista
  • Post sul forum 18

import GameLogic

import math

cont4=GameLogic.getCurrentController()

owner=cont4.getOwner()

speed=owner.getVelocity()

speedt=math.pow(speed[0],2)+math.pow(speed[1],2)+math.pow(speed[2],2)

speedtot=(math.sqrt(speedt))*2

vel=cont4.getActuator(“vel”)

vel.setProperty(“Text”)

vel.setValue(str(abs(int(speedtot))))

GameLogic.addActiveActuator(vel,1)

riga 4:

method get owner is deprecated, use the owner property

riga 11:

method get actuator(string) deprecated, use actuator[string]

riga 12:

method set property deprecated, use “nome property”

riga 13:

method value deprecated, use value property

riga 14

add active actuator deprecated, use controller activate

piu di questo nn so dirti, in effetti ci capisco poco-niente