Is there anyway to prevent Sprites from losing/gaining velocity when they collide with objects? Also, is there a way to make Sprites so they are solid for everything, except for themselves? As in, they are moving towards each other, but instead of bounding off of each other, they move thru each other.
If not, then is there a way to stop them from losing velocity when they collide with a object? I set them for a certain velocity, but if they collide with a collidable object, the velocity changes. I sent bounce to 100%and drag and friction to 0.00 for them and for the walls they’re bouncing off. Im trying to make a game where the speed of these sprites is perpetual and constant. Meaning, they’re velocity cannot change when they collide with other objects.
The walls and sprites are set to 100 Bounce, and 0 drag and friction. This design relies on the sprites maintaining their velocity no matter what.
Setting an Always instead of Once causes the Sprites the agitate. How do I keep the Sprites moving at their velocity, unchanging no matter what they run into?
make it “motor” and “always” then they keep on going :l But I don’t think that answers your question. So what is your question?
That does answer the question about them not losing or gaining velocity when they collide with other sprites.
Is there a way to keep them on a set path and make them so they go thru other Sprites? I want them bouncing off walls, but if they bounce into each other, i’d like for them to go non-solid, just for when they collide with each other. So they’re solid for the player and for the walls, and can collide with both, but with each other, they’d clip thru each other and not collide.
By path i mean diagonally. Go up to the right 45 degrees (like this /) hit a wall, then go down 45 degrees (like this \) then bounce back up like this \ hit the wall, and bounce back down like this / , on repeat.
Instead of bouncing / going down \ and bouncing away to the right.
Translation: Putting sprites on a set path. First part: Go to the upper right. Hit a wall, drop to the lower right. Then: Go the upper left. Hit the same part of the same wall. Drop to the lower left. and repeat.
AHA! I created a Collision Behavior and connected it to the Back node on a Flip Behavior. Then, i connected one of the Out Nodes into the In node for the Number. As in, the Number which is plugged into the coordinates for the Velocity!
Also plugged into the same Number, but seperate (as in not connected) to the Flip, is a once. I set it to a slow speed and so far it’s still going, not slowing down.
Note: I noticed that setting it to 1 or -1 doesn’t work. Setting it to 2 or -2 i guess gives it enough speed to keep going. Allowing the Collision - Flip (thru the Back node) to allow it to keep going.
I think this will solve the issue as well of it going off in a random direction and changing speed. Because with this, if it hits something, the Flip Behavior will force it back to the velocity. And the Flip behavior should override its tendency to want to change velocity and direction and go shooting off randomly, or slowing down or speeding up.
Yep, still going. that is a successful test!
Here is the setup:
Once > (In, the node that’s connected to the Once) Number (x, where x is the value in the number behavior) > (x or y or both) Velocity.
Collision (set to Any Type or specified type) > (Back, the node that’s connected to the Collision behavior) Flip > (In, the node that’s been connected to Flip) the same Number behavior as mentioned before.
Once > Number > Velocity
Collision > Flip > same Number
^ This is how you set up a perpetual patrol Otherwise, it will slow down when it hits something. Setting the velocity to Always Number Velocity makes it agitate. Setting it to Once Number Velocity causes it to lose speed.
The Flip (with the Collision’s Out node connected to Flip’s Back node) and that Flip behaviors Out node (any of the 3 will do) connected to the Number that’s connected to the Velocity keeps it moving.
5 is simply an example. Any value will do (except for 0, 1 and -1) Also, the Collision can be set to Any Type. I have it set to the Sprites I designated as Wall, but any sprite type or the Collision setting “Any Type” will work.