im trying to turn 3d models into buttons using the button states behavior but it isnt working. is there any way i can do this?
It works. Can you screen shot your events that handle the click condition on the model? And screen shot the ButtonFSM behaviour added to the model? You may need to make 2 replies to get each screen shot in this topic.
FWIW, here’s my behaviour on the model:
and this event turns the screen red when I click on the model of building:
I think the reason why it doesn’t work for me is because I’ve got the layer at a 45° angle and looking at a position. Is there a fix for that?
Can you screen shot your events that change the angle to 45°?
I am not 100% sure
But i would assume what Ben meant is that his object is not in topdown view
But more like in front of camera
Which i have no idea should affect anything
I figured it out, I can click the 3d object but I can only click the bottom of it because of how develop handles 3d objects
This is an “oh yeah, that’s right” moment. The button FSM is for 2D objects, and that’ll be the base of the object.
You can manually make the 3D object a button:
- Remove the button FSM behaviour.
- Add the “Raycast 3D” extension to your game.
- Use the following conditions:
On discord he posted video from his game
That finger cursor is not in center of camera neither his model
So how casting from center of camera would work here?
I am new to 3D not even a week into it so i want to understand it
Where my idea and what i suggested on discord
Was to use this action
BUT he would need to offset position of raycast to where cursor is in relation to camera
BUT IDK how to do it
Or would your method with his camera angle and fact cursor can be anywhere
Would do the trick?
This is only the camera angle for the tutorial and it would change once the tutorial is finished, I’m also trying to make multiple 3d objects on my scene buttons.
This does complicate stuff I know.
What would be brilliant would be someone making a 3d object button extension that knows how to handle the depth of an object.
You do not need it to be button
Raycast would cover what you need
And only thing required to do what you wanna do is calculate angle of ray in 3D and you would be perfectly fine
However i think it involves cos and sin in equation and idk how to ose these
You should use the Raycast from a camera point action.