How to jump forward to a direction the camera is facing?

I’d like to make a button that allows me to jump forward to any direction the camera is facing (which is not space bar)
So here is my code: CoSpaces Edu :: Jumping without space bar
There’s a small ellipsoid in the bottom left corner, currently it can only jump (it is basically a space bar)

I wanted to make it jump forward to the direction the camera facing, but I encountered problems that I can only jump in one direction
I knew there are blocks that can help me, but the direction is presented as (direction of x), (direction of y), (direction of z), and I don’t know how can I obtain what the camera is facing by the 3 values, can someone help? Thanks.

I created another version of it (CoSpaces Edu :: CoSpace 3)
Since I do not know what to do with all the direction given, I added a circle under the camera, and since everytime I jump it is the same distance, therefore the distance can be the radius
I then made another camera1 to simulate where the main camera will go, and I calculated how will it land (it is wrong whatever, I do not know the forumla for that)

By the way, I noticed whenever I simulate the jump, the falling speed usually is faster than pressing spacebar by a lot, anyone know how to fix it?

Found a simillar project that is what I’m trying to do: CoSpaces Edu :: Speedrunner Parkour, in case I didn’t explain it clear enough

Hi I’m sure these Tech Guys have a good solution for you @techleapnz @EdTechnocation

Hi @TerribleAtCoding,

It is tricky, calculating such a transition using CoBlocks, because the CoBlocks don’t currently tell you whether they use GLOBAL (world) or LOCAL positions or movements or directions.

You’re correct to use the move to xyz position, as this uses global co-ordinates. The move Item x metres up/forward/backward in y seconds uses local direction, so you can use this with the other in a run parallel block to go up and forward (this is limited, as it depends on where the camera is facing).

There are other options, like adding a helper object as a parent, but that requires adding controls for all movements manually.

If the camera’s jump velocity could be set, such a mechanism would be easy.

Hope that helps a little!

Geoff @ TechLeap

Hi @TerribleAtCoding, I don’t know if this example is what you need but with only a block and using physics you can obtain a jump forward. Obviously camera and cuboid have the same orientation. Look here and tell me if it helps you: CoSpaces Edu :: CoSpace 159

1 Like

Hi again, I noticed that my previous example has a problem when turn the camera so take a look to this new CoSpace… you can use camera1 to see what happens.
Cheers and happy new year!


You did it​:heavy_heart_exclamation: Now we can jump even using a cellular :star_struck: Thanks Giuseppe

1 Like