Vgreen
December 12, 2020, 9:12pm
1
Hi, I hope that everyone is doing well. I have run into a weird issue with the camera.
Here is the init for the camera
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("#camera", "acquire_camera_focus")
self.velocity = vmath.vector3(0, 0, 0)
self.correction = vmath.vector3()
self.ground_contact = false
self.anim = nil
end
Here is how I have it set up:
And I am getting an error saying:
ERROR:GAMEOBJECT: Component '/player/player#camera' could not be found when dispatching message 'acquire_camera_focus' sent from default:/player/player#player
Any ideas?
I have tried the with and without the “#” in front of the camera in the script.
Thanks!
Potota
December 12, 2020, 9:15pm
2
Try using /camera#camera
as the URL.
Vgreen
December 12, 2020, 9:17pm
3
Ok, that returns a different error:
ERROR:GAMEOBJECT: Instance '/camera' could not be found when dispatching message 'acquire_camera_focus' sent from default:/player/player#player
Very weird.
Potota
December 12, 2020, 9:24pm
4
If you click on the camera component, what is its Url property? That should be the right one to use. Also, make sure to rename your collections from default
.
Vgreen
December 12, 2020, 9:29pm
5
/camera#camera
The Camera GO is /player/camera
Yes, thanks for bringing this up, I always forget. Just made that change.
Potota
December 12, 2020, 9:32pm
6
Then try /player/camera#camera
as the URL.
1 Like
Vgreen
December 12, 2020, 9:35pm
7
Potota:
/player/camera#camera
This worked, thanks!
Silly mistake on my part, I appreciate it!
1 Like
Vgreen
December 12, 2020, 9:36pm
8
Another quick question, how can I center the camera on my player? Right now I only see the corner of it’s face.
Potota
December 12, 2020, 9:37pm
9
Move the camera GO to your player’s coordinates.
1 Like
totebo
December 12, 2020, 10:08pm
11
Also, consider the Orthographic camera extension:
2 Likes
Vgreen
December 13, 2020, 1:09am
12
For sure! Traditionally I would use Orthographic but this project is for a Hackathon where libraries or external code cannot be used. Thanks!
1 Like