#How to conserve momentum through respawns but change the direction of the momentum
111 messages · Page 1 of 1 (latest)
Don't use respawn, use set pos and velocity set.
get the entrance velocity and invert it on the way out
this is def a Ctrl + F moment.
second question, h o w, im not the best with the velocity chips
get velocity then subtract it from itself twice
so this would work per direction?
Welp, hopefully CC finds this and links the proper threads. This is something that's already been answered. I couldn't find it, I'm dumb. 😛
so velocity - velocity - velocity
alright lemme try
yep i think?
https://discord.com/channels/193073071802941451/1078453222492094574
Found one of them
ive got static portals luckily for me, i wasnt about to code a portal gun tbh
Rotate the player rotation by inverse of entry portal rotation then rotate that by exit portal rotation, set transform the player with that as rotation if you want the player to face the right direction (pretty sure that's how)
so two subtract chips, one with just the player velocity, one with the player velocity and the first subtract chips result?
No 1 with 3 ports
@chilly parcel , that will make both direction and rotation good
Speed is just player velocity magnitude
Might have said something wrong, tell me if it doesn't work
all of this is currently going over my head, so first get the rotation opposite of the portal, transform the player with that rotation?
T55Milk is better at this than i am so go with their idea
Get local player>get rotation
Get entrance portal>get rotation>quaternion inverse
Get exit portal>get rotation
everyone here is better than me
Rotate 1 by 2 then then the result by 3
thanks lemme try this
so set player rotation by entrance portal then that by the exit portal?
Inverse of entrance
so just by the inverse of the entrance?
Then by exit
this is gonna be me gfetting to dumber levels, how again?
What
i have no clue what im doing is what im saying, this is honestly my first time screwing around with set rotations
like all i really need is just like the x and z axis kept for velocity
what chip am i using for rotation? there isnt a result? or am i using an add chip or sum?
These are the chip
Rotate 1 by 2 and the result by ,3
Then set transform
this is what im asking how to do
Multiply
ahh
it worked!
thank you
sorry for hitting roadblocks a couple times
wait
hold on
so ive got a portal at a | position and a portal at a _ position, i drop from top to bottom and its not pushing me forward
Legit do the same
but since velocity is a vectorrrr
hmmmm
Either convert it to quaternion
Or try with vectors idk if it works
Oh nvm it won't work
Just make the velocity as a quaternion
alright, i still have a respawn chip going, should i still use that?
what do i connect the pos input too again?
issue
im set 90 degrees anticlockwise from the area i want to be flung, also no flinging occurs
its fine if i just hook that to a pos of a vector gadget?
@chilly parcel @dusky cypress @solemn mesa @fathom olive
Here is a thread I helped someone with containing basically everything you will need for a portal
https://discord.com/channels/193073071802941451/1059293094119473233
The entire thread covers relative velocities and directions for entering and exiting portals
Yeah couldn't find it
Just search "Keep velocity"
uhfue thanks
@shrewd nymph do you always need a variable?
Yes
So set variable then set rotation?
Save the velocity direction
Save the look direction
- Rotate both by the inverse of the entrance portal rotation
- Rotate both by the rotation of the exit portal rotation
- Reflect both by the forward direction of exit portal
You will need a third variable if you want to keep relative position, which you probably should
Relative position is different, you cant just rotate it back and forth
Thanks CC, I knew you had a better thread.
Does it work with player rotation?
Save the look direction
tbh i might just make a "Portal relativity board" because its very confusing math
well, not to me, but
I know but is there a way to do it with player rotation too or only direction
No, because that wouldnt make sense for VR users
Oh
Or screenmode users
No, they shouldnt, ever
Rotating the camera would be disorienting as shit, and like I said, wouldn’t make sense
Mehh idk
See, for screenmode, it makes sense to be able to their look direction (No roll)
For VR, it only make sense to set their Y axis rotation, as anything else would rotate the camera in weird ways
But configuring the roll on either of those is a stupid idea
Yeah true
so i copied the code in the message #1059293094119473233 message
im obviously missing something
as well it doesnt take the down fall velocity and convert it
if i enter the bottom portal from the left side it does work
thats it
also is DEF speeding the player up
so if im falling down into the portal i dont gain any forward velocity out of the exit portal
the code in question btw
so the vec3 var is now in the player entered port, when excu it sets vel
That’s about portal hit detection stuff