#How do I make a Trajectory Cast?
1 messages · Page 1 of 1 (latest)
Do you mean a prediction of where movement will go?
Will the players see it? Or just as a raycast?
Ok. The way I would do it is by getting the velocity direction of the local player, then have a raycast chip start pos at the player, and direction of the velocity. If done right, it will make a straight line of where the player will go if they keep moving in that direction.
yeah but thats not what im trying to do
raycast is a line
trajectory cast is curved
it uses a direction and gravity
Do you mean something similar to MegaHack in GD? Like this: https://www.youtube.com/watch?v=ucM0Aex0Pv0&t=6s
Today we go to extreme demons and use trajectory on their memory parts
The trajectory mod is included in the mega hack made by Absolute. Check them out! https://www.youtube.com/c/AbsoluteGamer
#geometrydash
uh
1 sec
hmm
well
let me set an example for
lets say that i use a raycast, but its modified, so the direction would be (0, 0, 1,) also taking account of gravity, so it would curve down in the xyz vector
based on the value of the vector
it goes farther
I don't think that's possible. In RR, only straight lines of raycast can be done. You would need extremely complicated physics and ray cast systems for that to work.
yeah
so thats im trying to do
complicated math and [hysics
physics
its possible
I could imagine it would be done with hundreds of tiny raycast chips.
each going 0.01 meters, than doing physics stuff to calculate the next part
i didnt literally mean curve down
like it would still be a line, but taking account of gravity and pointing down
so its like a curve
but you dont see it curve
So it would point in the direction of where the player would land if they jump/fall?
yeah
but im thinking i use objects
they are more smaller and easy to use
rather tha players
You could probably do what I said above with velocity, but do some math to take into account of how fast the player is falling to make it more accurate
i tried getting an answer multiple times but i always got something i couldnt understand
U want to calculate where a projectile will land
Based on what?
Angle and velocity?
Probably because Physics Math Circuits don't exist yet. So it can't calculate gravity or stuff like that.
@dusty portal He's trying to make something similar to this:https://www.youtube.com/watch?v=ucM0Aex0Pv0&t=6s
Today we go to extreme demons and use trajectory on their memory parts
The trajectory mod is included in the mega hack made by Absolute. Check them out! https://www.youtube.com/c/AbsoluteGamer
#geometrydash
That green line.
yeah but that happens while in motion
I'm thinking as soon as you drop something like a ball it would then do the math and show the hit position
after its dropped
Yeah. I'm not sure if you can do that.
bruh
you can\
theres videos about this stuff but its always in unity or something
so i would need some equations
to do the math easily
I mean with circuits.
but you can bruh
I don't know if there are circuits to do that.
Then take what you see on unity, try and convert it into RR.
ok bet
What
actually
the I think i can just subtract the y velocity by the gravitational pull of earth
9,8 squared
nvm
yeah hats the equation im using
im just figuring out how that works so i can make it in rr
so initial velocity, gravity, x and y components
should be simple
what are u typing bruh
the good thing about that equation is that it doesnt take account of air resistance
just like in rr
Start position * tan ( angle) -
96.04/ cos(angle)^2(2(velocity^2)
Wth
Everything I said are chips I'm rr
idk why i think that would work 💀
is that the whole trajectorty cast
little confused on what that adds up to
That's the hit position
oh thanks
is the angle as it's in motion or is it initial angle
The initial
alr thanks
@fossil star there is a much easier way to make a trajectory cast
what is it
StartPosition + (StartDirection * (Velocity * Time)) for no-gravity
StartPosition + (StartDirection * (Velocity * Time)) + ((0,-1,0) * (4.805 * Time^2)) with gravity
what is time
StartPosition = Position the bullet was fired
StartDirection = Direction bullet was fired
Velocity = Speed of bullet in meters per second
Time = Time since fire
it's not a gun
it doesnt have to be a gun
is time like a 0-1 thing where 0 is the initial raypoint and 1 is the hitpoint or?
When you fire store the current time get precise seconds as a float variable.
Then subtract the time get precise seconds from the time you stored to get the time since shot
No, its time, not normalizedtime
We have no clue of knowing when and where it hits, thats the point of making your own cast function
ah i see, slightly different, never been the best with this type of math stuff lol
thanks for sending the equation :)
wait so in this case you'd have to keep checking for a hit while time increases right? what if the bullet goes at such a speed where between the ticks in 30hz it passes through a solid, it wouldn't detect any hit and keep going no?
assuming it's constantly being checked by a 30hz after fire
wouldn't you instead want to make a raycast between t && t+x
and check if that ray hit anything
might sound a little dumb but wdym time since I stored?
I'm confused cuz I never used time get precise second b4
when you fire the projectile you save universal time to some variable, then you subtract that time variable from universal time to get the time since fire
let's say the time of the universe started 10 seconds ago and we fire
you save 10
after 2 seconds the universal time is 12
so you get 12-10 == 2
time == 2
(i know you're not firing a projectile or whatever, just using it as example)
yes
precise seconds, npot universal
we need float precision
Right :0 mb
sorry for asking so late but can you help me with this in rec room
Did u use cryptics one?
Ok give me a sec
my user is @Sinning
u getting on?
I can't get on but I'll send a picture
Vector create is the start position
And the tan and cos input is the angle
@fossil star
ok
Vector get magnitude is for the velocity
oh so the empty float values are for magnitude?
but the vector magnitude is for the values with 0 right?
That's the velocity
yeah I know
vector get magnitude is the velocity
I'm asking if the empty float values with 0 are for the velocity right?
The Cos And Tan Chips are supposed to be ur angle
I'm confused
so they just stay at 0?
ok
it doesn't even go to the landing position
it either goes to 0, 0, 0, or it goes somewhere in a wall
ok
I changed my mind
Send a picture
It's a bit complicated
Did u try cryptics?