I want to make it so I can add an object via a true pulse sensor in python, but it only gets added once regardless of the true pulse. For instance, the object (a crate) hits a surface, creates a splash, but doesn’t create any more than just one. And how can I make it so it works with multiple splash objects in a list? I’ve tried a globalDict counter, but it doesnt work. I’ve tried a list and using > to make it so there is a check for more than one splash to stop adding. Nothing. I’ve tried everything Python related. I am at my wits end.
The way this is meant to work is as follows:
- An object (can be multiples at a similar distance) strikes a plane.
- The plane is scripted to add multiple splash objects of different sizes.
- Even if the Collision Sensor is set to true pulse, the splashes will not be added more than once when the object is passing through it. This stops multiple splashes from appearing below the surface.
- The script checks if there are too many splashes being added (the sensor triggers twice and more times than once), and disables adding any more splashes, but only once a small tiny delay has passed.
But no matter how I do it, it either makes errors or just ends up with the same result as before - splashing twice with multiple instances of the same object passing through the plane, which is not a good look for water. I want to make it so once a splash has occurred, a check is run on the object hitting the plane, if it is passing through and creating a second positive pulse, the check then disables a second splash from occurring once the object is at its middle in the plane or already in the plane.