# Moving the robot's legs

593
4
11-27-2023 12:29 AM
by
New Contributor II

Hello friends . I want the robot's legs to move when I change the attribute of the Robot_Move. Its value is between positive 20 and negative 20. However, when I change the DistanceMove(n) between positive 20 and negative 20 , the robot's legs to move. when i change the value Robot_Move attribute which causes the robot's legs to move .Does anyone have a solution?. Thank You

Tags (1)
1 Solution

Accepted Solutions
Esri Regular Contributor

Here is a prototype of a walking animation based on Tutorial 18: Handles—ArcGIS CityEngine Resources | Documentation

It can be achieved by making the following modifications to biped.cga (s. attachment):

4 Replies
Esri Regular Contributor

Hello @Farhan

Thanks for your question. Your robot looks like a fun education project.

To me, it looks like you are returning a floatArray from the distanceMove(n) function. However, the r operation—ArcGIS CityEngine Resources | Documentation needs a float input.

I suggest, that you adjust your function in a way that you derive the leg angle from the Robot_Move value.

All the best for your project!

by
New Contributor II

Thank you Thomas for your reply. this is good idea. What I think is that attribute Robot_Move should be written inside a function that repeats the value of attribute Robot_Move as a repeating loop until the limit of 5, then moves from 5 to 0 again, and this causes the robot's legs to repeat in The distance becomes 5. and another idea is to add the value of attribute Robot_Move to its inverse value, if the maximum value of attribute Robot_Move is 20, then by adding the inverse value of this attribute to the normal state, every time we change attribute X, its value becomes 20, and this number is Negative 20 and positive 20 are repeated in a loop, which causes the robot's legs to move

However, the problem that exists in using the array for this case, as you said, does not accept the r of the presented value and gives an error. Is there a way to remove the array from the function?

my English is not very good, if there is something incomprehensible, please tell me so that I can correct it

Esri Regular Contributor