Jump to content

Error on Simple Door Closing Expresso?

Go to solution Solved by jed,

Recommended Posts


I have a "simple" door closing expresso set-up. 
It works if it goes from the left to right. But it doesn't from right to left. 
I would expect the door to stay close if the direction is right to left. 

You can see the problem here:

You can check the illustration file here:


Link to post

4 hours ago, bentraje said:

I would expect the door to stay close if the direction is right to left. 

Ay, there's the rub.


You expect something to happen in dependency of the direction, but the XPresso setup only has the ball's x-position as input - the direction is not an input at all, and never checked in the setup. So, the output depends only on the position of the ball, regardless of the range mappers, and thus the door angle disregards the ball's movement.


What you actually have is a dynamic situation where the position of the door and the position of the ball interact. If you do not want to solve this with true dynamics, you will need to represent a more simplified dynamics setup in the XPresso, and include the current state of the door in the input. Moreover, you don't currently have any "gravity" that is closing the door, so once the ball has passed the door, and you move it back, the door will open again. To simulate "gravity", you'd need to close the door a bit with every passing frame, unless the ball is blocking it.


In short, your setup is too simple for the task.


As basic workaround, you can use a memory node to remember the ball's previous position, and derive the actual direction of the ball's movement from that. Then use that to control the opening direction of the door. However: This will cause a "jump" in the door's angle if you revert the ball's direction while the door is still open; so it's only good if you move the ball all the way from left to right and back.


Link to post

@Cairyn @jed

Thanks for the response. And indeed the dynamics is much better, but I prefer the stability of the xp set-up as I'll be using this on rigging. 
Thanks for the illustrations files. Works as expected. 

Have a great day ahead! 🙂

P.S. Thanks for pointing out the memory node. This is my first use case of it haha

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.


We are dedicated Cinema 4D Community of friendly and passionate artists, hobbyists and developers. Feel free to join us and share your knowledge, your art and anything that might help Community to grow. We are providing guidance, free plugins and files, feedback, sponsorships and various discounts for our Contributors. :cowboypistol:




  • Create New...

Copyright C4D Cafe © 2020 Powered by Invision Community