Hi.
I am learning a bit of py and i really need to know how to control a value with a propriety, i want my script to copy the values from propriety.
import bge
scene = bge.logic.getCurrentScene()
cam = scene.active_camera
cam.lens = 100.0
I want to control the cam lens in realtime with propriety,
A blend file would be greatly appreciated!
agoose77
(agoose77)
2
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
scene = bge.logic.getCurrentScene()
cam = scene.active_camera
cam.lens = own["lens"]
using the property ‘lens’ on the script controller object
If the object with the script running on it is the camera, use this:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
own.lens = own["lens"]
using the property ‘lens’ on the script controller object
I ve been making some other scripts and really works, so nice!