Problem:
I’m working on a Python simulation where I’m controlling a character’s movement towards a target position. Here is the relevant part of my code:
character_graph.set_variable("Action", "Walk")
character_graph.set_variable("PathPoints", [carb.Float3(current_position), carb.Float3(target_position)])
character_graph.set_variable("Walk", speed)
However, I’m unclear about the exact role and impact of the speed variable, especially in relation to the simulation’s time-step (dt).
What I Want to Achieve:
- My simulation starts with a time-step of
dt = 1/100. - I need to set the character’s walking speed so that they reach the target position within a specific duration.
- Specifically, I want the character to reach the target position after exactly
1/10seconds. - Once the character reaches this position, I plan to set a new goal position and adjust the speed for the next period.
Specific Questions:
- How should the
speedvariable be defined to ensure the character reaches the target position within the desired time frame of1/10seconds? What calculations or adjustments should be made to the code? - How can I correctly relate the
speedvariable to the physics simulation time-step (dt) ? - Are there any other parts of the code or the simulation setup that I need to modify or consider?