Changing the time scale of individual objects
by Mann Made Media (#0001) · in Torque X 2D · 09/05/2007 (5:41 am) · 7 replies
Hi
I'm trying to create a sort of "bullet time" effect by slowing down everything else in the game and leaving the player running at the same speed. So far, the way i'm looking at is to change the engine GameTimeScale, but this changes everything's timescale. I was thinking of maybe moving the player from the GameTimeSchedule to the RealTimeSchedule, but have no idea how to do this or even if it would work (or have some really bad repercussions). Am I going in the right direction, or is there a better way to do this?
Any advice with my approach or a better one would be greatly appreciated.
Thanks
PhoeniX
I'm trying to create a sort of "bullet time" effect by slowing down everything else in the game and leaving the player running at the same speed. So far, the way i'm looking at is to change the engine GameTimeScale, but this changes everything's timescale. I was thinking of maybe moving the player from the GameTimeSchedule to the RealTimeSchedule, but have no idea how to do this or even if it would work (or have some really bad repercussions). Am I going in the right direction, or is there a better way to do this?
Any advice with my approach or a better one would be greatly appreciated.
Thanks
PhoeniX
#2
09/05/2007 (7:24 am)
How do you speed up everything about the player including his velocity and animation speeds?
#3
09/05/2007 (2:56 pm)
You're definitely going in the right direction. I've never tried to do this, but I imagine you could get it to work if you subclass the T2DPhysicsComponent to allow a scalar to be applied to the velocity before it's processed in ProcessTick. You could then slow everything else down with GameTimeScale and scale the velocity of the player up using that component. It would also give you more granular control over the speed differences. For example, you could slow everything down to 1/2 speed, but only slow the player down to 3/4 speed - so the player still appears to be moving in slow motion, but still faster than everything else.
#4
09/06/2007 (12:30 am)
Hmmm... wouldn't that only speed up his velocity, and leave his animation running at the slowed down pace (looking a bit bizarre with a sort of sliding effect - this is for a platformer)?
#5
09/06/2007 (3:23 pm)
Doh! Yea, you're right. If you have Pro you'll have a much cleaner way to do things. Basically, by adding a second precess list to the ProcessList that gets ticked by the TorqueObjectDatabase without any time scalar (or with a different time scalar). Then you could add the object to that process list instead of the main one.
#6
09/07/2007 (12:36 am)
Damn. Is the only way to do this if you have the Pro version (cause I don't)? Is there no way that I can fiddle with the GameTimeSchedule and RealTimeSchedule, or have I misunderstood what they are for?
#7
09/07/2007 (4:31 pm)
That might be possible. You don't actually need source, but that is the most "correct" way to do it. You could also override animated sprite as well and make sure it's animating at the correct speed (along with the physics).
Torque Owner rwillis