i am having a look at using paths with the GUI system atm, but that second menu system that you like in the video you posted could be done the same way as planetX using a vector3 lerp from position to position for the camera and a rotation to rotation using the quat.slerp() function to make it point in another direction. No paths really needed for this.. whereas the mountain at the start of the video would need a path to rotate backwards around the path to get to the menu position.
Ill see what i can come up with and see what problems are encountered along the way.
Edit:
First tests:I have a scene script with this function:
- Code: Select all
function myfunction( path )
if(path == "new_game")then
lprint("new game selected");
elseif(path == "options")then
lprint("options selected");
elseif(path == "exit")then
lprint("exit selected");
end
end
which is called from the onclick hook using these 3 buttons events:
- Code: Select all
lua(sceneScript,myfunction,new_game);
lua(scenescript,myfunction,options);
lua(scenescript,myfunction,exit);
These print into the console when used.
Second Test: Shifting the exit one to the mouse over hook also triggers the function.
However, the hover needs to be moved over the top of it in order to keep activating, therefore i recommend using a mouse out hook to know when you have left the button and use the update loop to handle the camera movement or whatever happens
when hovering
Third Test: I can see how the paths seem difficult considering there is no lua code to control cameras on paths from the lua camera.library(). It does seem pointless to make them use an entity follow path since they have their own inbuilt path system, so i will be adding the commands to control paths in the camera lua. This should make it easier.
I will also be adding a camera.hasReachedDestination() function to know when the camera is at the end of that path to tell the system to display next menu or whatever needs to be done lol
For now, as mentioned before, just use a position lerp between 2 points and a slerp between 2 rotations.
My advice would be to add an object at the positions of where the end positions are and use a single starting point. Use the editor to orient the meshes in the correct direction, then turn their visibility off and use grab their positions, orientations in code, then blend between.. Its easier than it sounds lol