Angular Velocity not working (bug?)
Paxton
Member Posts: 89
I have in my game a wheel, and I need to record its angular velocity in an attribute. Not that easy, apparently.
The wheel is spinning by an 'interpolate rotation' behaviour, because I want that 'ease in/out' effect. However, if the rotation is started by an interpolation behaviour, the Angular Velocity of the wheel will ALWAYS be 0.
If I spin the wheel using 'Rotate' behaviour, the angular velocity works...
Comments
Everything seems to be a bug these days, can't get GameSalad to add 5 and 5 up and get 8 ? Must be a bug.
The Interpolate behaviour doesn't use the physics engine, it simply interpolates one value to another, so will not show a velocity reading.
If you're interpolating a value then you already know the distance (ending value minus starting value) and duration. Since speed is distance divided by time, you should be able to calculate the speed.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
If you're using a linear interpolation, this demo will log the speed of the rotation, although again it could also be determined before the interpolation starts.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang Thanks for the suggestions, I will try and see what I can do! The example seems like a good workaround, but a bit complicated if I integrate it in the circumstances of my game. Good input though!
@Socks I always appreciate your quick replies to GS issues, BUT: I always get the feeling that you get REALLY defensive whenever someone makes the slightest hint that GameSalad could be better in certain ways. Considering this thread, you are not correct. Even if I use interpolate to spin a wheel, the wheel ... well ... SPINS! - so that means that it should have an angular velocity. Please tell me if what I said does not make sense.
Nope, this idea is completely wrong, I'm often critical of GameSalad, you'll often hear me complain about its lack of very very basic functionality, like folders, multiple select, zoom functionality and on screen guides, snap to grid and so on, all basic features missing from GameSalad, I'll also often moan about how expression windows open up so pointlessly small or how windows lose their position and size if you navigate elsewhere or how deleting images is so buggy that without the correct preparation (saving the file as a new version) you can risk screwing up your project, something that has been broken for years, you'll also hear me complaining about the arbitrary limit on fonts sizes, the inability to change the background colour of the image assets window (currently white images are effectively invisible), or complaining about both the default text colour and the default actor colour being white (meaning you need to change one to make text readable), or complaining about how we are unable to place actors into a scene on whole pixel values, meaning for every actor placed you need to round up both its X and Y position, which adds up to thousands of needless small tasks for every user . . . as well as many other complaints about issues with the way GameSalad works . . . in fact I complained so much, and so vehemently, about the state of the early forum software that it was deleting attachments, locking people out, deleting posts (and so on) . . . that I was actually banned from GameSalad for life ! It's was only months later that the decision was made to let me back in . . . so, the idea that I am defensive when there is the slightest hint that GameSalad could be better is laughable nonsense !
I'm not defending GameSalad, I'm pointing out how common it is for people to cry 'bug' when they can't get their project to do what they want it to, of course bugs crop up from time to time, but more often that not it's user error.
It does make sense in that it's a coherent sentence, it's just that it's wrong, the Interpolate behaviour doesn't use the physics engine, it simply interpolates one value to another, so will not show a velocity reading. Another example would be to use a timer to change the rotation of an actor by 0.1° every 0.01 seconds, you'd also see the actor 'spin' but as this is also not using the physics engine, there would be no velocity value to display (or otherwise use).
@Socks I think Paxton should take this to the paid help section because it sounds like the help he's looking for may require some work hours.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
I was going to put this in my freebies thread, but it seemed relevant enough here that I tidied it up a bit for sharing now. A not entirely simple way of easing in and out of a rotation (with control over how fast the ease takes place) while not using interpolate. I'm sure the method could be improved a bit, but maybe it'll help for now!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
That boat is toast, @Armelline. But cool effect.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Very nice ! I admire anyone who can work a nautical theme into a demo project.
Here's another way you could do it.
Rule: When mouse button is down.
---Rule: When attribute self.Motion.Angular.Velocity is ≥ 1
------Constrain self.Motion.Angular.Velocity to self.Motion.Angular.Velocity -1
Otherwise:
---Rule: When attribute self.Motion.Angular.Velocity is ≤ 200
------Constrain self.Motion.Angular.Velocity to self.Motion.Angular.Velocity +1
Example attached:
(let it spin and then press anywhere on the screen to apply the brakes)
Love it! And if @Paxton doesn't have some kind of boat in his game I'm going to be very disappointed now.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Holly !@#$% ... I swear that if my games make millions you will be the first developer that I'll hire for a fat salary! I had developed a method last night which did a worse job at going about at this, and it involved 20 times more rules and behaviours.
Well, there are some fish involved, so close enough!