I moved the Xpresso tag from the car to a Null called “Xpresso” for easy finding.
The floor and walls are combined, which makes collision detection by Xpresso impossible. I couldn’t find a way to have a concave collision object. You need to have separate objects for each wall and use an “objectlist” with all the parts inside as your collision object.
Collision in Xpresso also requires editable objects (press C to make editable), so I used a hidden collision object in its place that sticks out only on the front and back.
To summarize the Xpresso set-up, I used a collision node to check. If collision occurred, toggle the “flipflip” node. This went to a switch, turning a “1 or 0” to a “1 or -1”. This then multiplied against the desired speed and output to each motor. Each step has a “result” node, so I can see if it was working.
Also, the dynamic tags must have enough bounce to push the object away, otherwise, it will continually switch directions back and forth and get stuck.
Check out the file attached. I have like a month of experience with C4D and would love to hear other possible solutions. Also, please show me what you do with it! 😀
4698_selfmovingcubesso04.c4d.zip