I am developing a “point and click” videogame and I want to replace the cursor that appears on the screen with a 3d model of a stick (yes a stick). The idea is that the stage light affects it so it can’t be an image, it has to be a 3d model.
Can anyone think of a way to do this?
Is it first person? You can just put the stick in front of the camera.
Hello, no, the game is a classic point and click (i.e. the camera is fixed) and the camera does not advance or rotate. On screen, there is always a menu, so the way to interact with the game is by using the cursor.
Got it. I’m assuming you don’t want the stick to be moving in and out of the scene, just staying near the screen plane, but also be a lit actor?
Some sort of world/screen mapping, lemme think a bit…
Effectively, I just want the stick model to move with the cursor (then I would make the cursor invisible of course) in such a way that it looks like the tip of the stick is the cursor.
I have been trying several options and another problem is that the 3D model would have to be above the menu buttons; I don’t know if this is impossible, to be honest, but I really appreciate your time.
I had a go at this, don’t think it’s possible, I’m afraid.
The stick has to be away from the camera, so you can see it, which means it’s in the world. But to be able to operate the menus, you need to be on the screen.
Maybe someone comes along with a bright idea, but…
I understand; thank you very much for your time. First of all, it occurred to me that the solution could be to make the physical menus also like the ones in the “Metro” videogame saga.
But I can’t find references or people who have done it before, so I guess it’s not possible.
That said, thank you very much for your time.
Wow! There is a moment in the video where he passes the mouse over the physical button and interacts! Maybe this is what I was looking for so long. Maybe it doesn’t solve the issue of the pointer being a 3D model; but it has been very helpful. I will see if I can do it too (I am still learning to use the program).
If you’re ok with moving the stick around in the world, you can use it with a line trace, and interact with models.
So, the stick stays upright until it detects an intractable object, then it points at it:
Wow, I didn’t know that could be done. If it works by moving the stick instead of the camera, I’m certainly interested where can I find a tutorial to do that?
Trouble is, I am moving the camera… that’s where the line trace is coming from
I’ll have a think about how to move just the stick…
I think you can solve the world space location of the mouse cursor using the APlayerController::GetHitResultUnderCursor function.
So how you do it:
first call the GetHitResultUnderCursor with let’s say with the ECC_Visibility Channel
then you get the hit result which contains the location the trace hit
subtract the camera location from the that location, and normalize it
that way you can use multiplication to adjust the distance between the camera and the stick
…
I hope that actually works, I am not able to test it currently
Hi, Thank you very much for replying, this is a lot of information for a beginner like me. I just found out what a “line trace” is and I am trying to implement it to work with a menu similar to “Metro”. When I get it, if I get it, I will try what you say.
I thought of a great way to do this, actually. If you’re ok with the stick entering into the scene…
Hello,
of course I want to hear your idea! Just keep in mind that I am still learning and will need a very detailed explanation to understand you.
Ok, I’ll come back a bit later…
And sorry if I don’t answer you right away, on the other hand, I’m replying to a post about playing videos inside unreal, apparently in the latest version of unreal there is something wrong and you can’t use them.
So I have 3 interactables here. When I press O, the stick goes to each of them in turn.
Tell me if this is of any use…
( I’m sort of imaging the stick to be a bit of a magic wand by now… )