Does anybody know how something like this:
might be programmed instead?
Thanks! perhaps this is a silly question but how do you get them to work after attaching them to an always sensor and python logic brick?
import bge
def main(self):
a = self.actuators["Mouse_Actuator_Name"]
if self.sensors["Always"].positive:
a.sensitivity_x = 2.0
a.sensitivity_y = 2.0
self.activate(a)
Mouse actuator attributes: https://upbge.org/#/documentation/docs/latest/api/bpy.types.MouseActuator.html
Ah, yes, so in UPBGE one can actually access python scripts through âGame Componentsâ. This will completely circumvent logic bricks.
The way to use the First Person Camera template is to add the python component to the âGame Componentsâ list in âGame Object Propertiesâ in the âPropertiesâ window. Seen here:
When adding a python component, the naming convention is python_module.ComponentClass. In the case of the First Person Camera template, it would be:
character_controller_first_person_camera.FirstPersonCamera
Python Components cannot ârunâ Logic Brick actuators. They can access attribute values using KX_GameObject.actuators, but they canât set any attributes, nor run any of the methods pertaining to it.
input_controller_min_viable_product(added_mouse_look_input)2.blend (882.5 KB)
this is for 3x, to make work in 2x is usually not too hard.
would PythonComponents run actuators in future version of UPBGE?
I think it doesnât make sense that you let component can access actuators but cannot do anything with it.
Iâm no longer part of the UPBGE team, but I would expect that if the mentioned feature doesnât already exist in UPBGE, it isnât likely that it will be added in the future. Of course, anyone who wants to contribute a new feature to implement it can, if they have sufficient experience.