I have a scene with a box connected to two wheels that are driven by motors. I have put this into a floor with four walls. When the box hits the walls I want the box to turn around or reverse instead of just stopping dead on collision. I wanted to do something where the collision from the wall triggers the reverse event using xpresso however I'm am not too sure how to do this. Below is a link to the cinema file I have been working on
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! :D