Hi all,
I am trying to link a camera with a Unit, so that when I click on a Unit(Chamfbox2.2), the view switches to the assigned camera view(Camera4). Attahced below is the flow for reference.
I followed 2 videos, the first video is for allowing for mouse picking, and the second video is for setting up a camera:
https://www.youtube.com/watch?v=dtpY_3-eGs0
https://www.youtube.com/watch?v=tsBP7OrAXZM
The two flows work individually (Thanks for the awesome tutorials by Dan Matlack!). I tried to combine them and the flow does not work in Test Level. When I click anywhere on the screen, the window switches to the assigned camera view(Camera 4). However, I want to switch views only when I click on the specific unit(Chamfbox 2.2). Anyone can provide help with this issue?
Any input would be greatly appreciated. Thank you.
Sorry, I'm not sure if the picture was properly attached, so have attached again. Thanks.
@Karlo456 wrote:Hi all,
I am trying to link a camera with a Unit, so that when I click on a Unit(Chamfbox2.2), the view switches to the assigned camera view(Camera4). Attahced below is the flow for reference.
I followed 2 videos, the first video is for allowing for mouse picking, and the second video is for setting up a camera:
https://www.youtube.com/watch?v=dtpY_3-eGs0
https://www.youtube.com/watch?v=tsBP7OrAXZM
The two flows work individually (Thanks for the awesome tutorials by Dan Matlack!). I tried to combine them and the flow does not work in Test Level. When I click anywhere on the screen, the window switches to the assigned camera view(Camera 4). However, I want to switch views only when I click on the specific unit(Chamfbox 2.2). Anyone can provide help with this issue?
Any input would be greatly appreciated. Thank you.
the camera that you are trying to switch to, is it attached as the child of your object or do you want to switch to any specific camera in the scene?
am trying to create a similar scenerio without using any code
Have taken two cameras and two object from basic scene chamfbox and basic floor.
first module casts rays and detect the object and second sets the cameras.
Not sure if this is the solution you require.
Thanks.
-----------
Thumbs up if you like this.
Apologies, but I am a beginner and do not have much knowledge of parent and child. But basically, for example if I click Unit A then the view will switch to Camera A, and I can still move around the scene. When Unit B comes to view, I can choose to click Unit B and the view will switch to Unit B, and so on. All the units are static.
I want to do this effect as the model I am working on is large and it would save a lot of time walking around by having some shortcuts.
So I guess that means I want to switch to a specific camera by clicking on their associated units. Hope this somewhat answers your question. Thanks.
Thank you so much for the examples, I am trying them out now. Just want to check, what is the script under "Script Do String"? Also, in Level Loaded, where does the middle link connect to?
Just some additional info, I don't think it can be seen in my flow screenshot, but initially I set it up whereby I am moving around the space and can look around, only when I press "c" the scene freezes and the cursor appears, and I can click the object. (I could make the object appear/disappear, but I could not associate a camera to it by clicking it).
Level loaded connects to other module which is not required here.you can leave it.
The script do is used to call stingray inbuilt function "stingray.Window.set_show_cursor(true)"
so you need not to write lua code which you were following in the video to display cursor.
you can use any button to to toggle this behavior along with the camera freeze.
just edit script string and enter: stingray.Window.set_show_cursor(true)
This will show cursor in the window
----------------------
Thumbs up if you like this.
Hi funfrank,
Unfortunately I tried your method and it is still not what I need. In test level, the view switches to the camera when I click anywhere on the screen. Does this happen to your sample project as well?
However, I need it so that only when I click on ChamfBox(Unit) then the view changes to camera 1. Am still trying to figure out how to create the desired effect 😕
I have attached the project file here , you can check out.
Also check the string data in the unit editor which is used to uniquely identify object.
https://drive.google.com/file/d/0B1MQcJBonLxfNWtzdW4weEFIU0U/view?usp=sharing
-------------------
Thumbs up if you like this.
Hi Funfrank and Shanii,
Thank you for the input. Have tried out the project file and it is something close to what I wanted. Now I just need to try it with the HTC Vive haha. Will update when possible. Cheers!
Can't find what you're looking for? Ask the community or share your knowledge.