Lots of Games have the cut scene transition where you press a button, your character moves to a certain position and orientation (smoothly not instantly) and then it plays an animation, of them getting into a chair or picking something up etc.
How would you set this up with python?
I haven’t learnt much so a simple explanation/example would be greatly appreciated:D
i have this same question, it might be that other game engines have an option to turn slow parenting on and off in-game. I’ve seen it in god of war, when you press O you can (smoothly) move to the enemies position and rip its head off or something.
*** moderation
Action: Merged 4 posts @BluePrintRandom: Use The Edit button. I’m sure you can see it in your browser and your mouse will not kill you when clicking on it. end of moderation ***
I would use align axis to vect, and use a empty (target of position) with a empty parented to it (align axis to)
and you can either apply force, etc, or do
if own.x>target.x: own.x=own.x-.01
if own.x<target.x: own.x=own.x+.01
if own.y>target.y: own.x=own.y-.01
if own.y<target.y: own.x=own.y+.01
here ya go
this handles X,y and rot
you can adjust values,
I can also use physics to move the player if need be
You can dynamically manipulate the offset of slow parent. But it makes no sense in this example, as I’m sure the character is not supposed to fly in a straight line towards the target pose.
If you want a smooth and simple result you could simply parent the player to the target location object and use slow parenting value.
this would align and move child smoothly to the parent. After that just remove the parenting.
EDIT: Bleh my method is no use. timeOffset doesn’t work if you parent object via Python. It only works on already parented objects with “Slow Parent” option selected.
My concept would have been something like this:
if k.positive:
obj.setParent(target)
obj.timeOffset = 200
target.worldPosition = [random.uniform(-5,5), random.uniform(-5,5), 0]
if sum(obj.linearVelocity) <= 0.0:
obj.removeParent()
EDIT: I used slow-parenting on making a simple elevator on my first-person project. I simply move the empty which is parent to the elevator object with enough slow-parenting on. works quite well if you don’t count the “nudge” at beginning and slow stopping at end
EDIT 2.0: That was one weird edit…I was suppose to edit and not answer to myself.