yes i wrote in first part how to copy vector over:
Math part:
Normalize second portal vector,
get length of player velocity vector in first portal
multiply length by normalized vector from second portal, put it into result vector variable
physics part:
After player is in new portal place, stop pawn, (there may be node to do this), or set velocity to 0.
Rotate it correctly
add impulse ( result vector variable)
and watch for mixing local vector space with world vectors. Use one of them do not mix both without adjusting.
thank you!!! This fixed it for me too )))))))))))))))))))
wicked you are a physics lord over the dominion of mathless noobs, one question i get funky behavior when the player isnt jumping, is this because isfalling +false? any ideas to fix this
Yes I wrote in first part how to copy vector over:
math part:
Normalize second portal vector,
Get length of player velocity vector in first portal
multiply length by normalized vector from second portal, put it into result vector variable
physics part:
after player is in new portal place, stop pawn, (there may be node to do this), or set velocity to 0.
rotate it correctly
add impulse ( result vector variable)
And watch for mixing local vector space with world vectors. use one of them do not mix both without adjusting.
second thought, i did something wrong and its broken again. I just need to keep the players speed, and totally change its direction, right now the player successfully moves to the new location and takes the forward rotation of the second portal so hes facing the right way, but he keeps the momentum from the first portal entry and flys like sideways or sometimes right back into the portal. you were definitely onto something with what you said previously but i did it wrong i guess, cause it was half working, and now its just not working. Is there any way i could just use the vector length and just apply any and all speed to the forward vector of the second portal
Last edited by Reactant; 11-13-2014, 04:13 PM.
Reason: im an idiot
to get it all working in world space, before all vector math translate player incomming vector to local space of portal A
The after vector math and before applying player speed again translate "result vector" to portal B local space.
I do not remember node names now for those translations. I am also afraid you need to do some rotation + vector math because there may be no node to simply translate.
Ive got two, lets call them portals, when something touches one it gets sent to the other, it maintains its velocity pretty well, but it always comes out in the same world velocity it went in, which can cause a problem when two portals are side by side and entering one causes repeated flying into the other. Basically i just want to translate the old velocity and launch the player with the same velocity but on the x of the portal. Sorry for the wording, ive been at this for hours and im tired. If you need more info ill provide anything
Leave a comment: