The default render script has a z render range of -1 to 1. Try 0.01 and 0.005 for example or change your render script’s range.
Yeah I ended up replacing the whole thing and recreating and it worked. I still can’t seem to get the camera process to work though. How do I make it acquire camera focus. This is what I’ve done so far:
Under main.collection —> create game object —> rename it to camera.go ----> add camera component ----> move camera.go into the player.go game object
Created a camera.script —> posted “msg.post(”#camera", “acquire_camera_focus”)" in it ----> added the script into the camera.go game object
The camera won’t follow the player. How do I make it acquire camera focus?
Thanks
Take a look at this example: https://github.com/britzl/publicexamples/tree/master/examples/rotate_and_move
Appreciate the plug-in but I am still confused about how to make the camera acquire focus? Like where do I post that message?
Which plugin? The example I posted uses a normal camera component.
You post to the camera component. Imagine the following setup with a player.go containing a script and a parented camera.go with a camera component:
In the player.script you’d do:
msg.post("/camera#camera", "acquire_camera_focus")
That’s it.
I actually ended up using your thing but for future references I’m still trying to learn so bear with me please.
^^This is the error I’m getting in the console. It won’t let me run the program at all.
^^This is my collection. “player.script” is the animation script for my player while for “camera.script” I literally copied and pasted what you told me to and that’s it.
thanks
Is this in a collection that is embedded somehow?
What if you omitt the initial forward slash of the URL to the camera component? Put a print(msg.url()) in the unit function of the camera script to get the URL of the camera go. Let me know the result.
I uploaded the steps that I took. I even have the errors for it. For this video, I created the game object (camera.go) on the editor(the left one) while the pictures in my last message, I created the game object camera.go in the collection itself. I don’t think it makes a difference imo
video is 4 minutes long, sorry
thanks.
Ok, so, I see what’s wrong. The camera.script doesn’t have any of the lifecycle functions in it. It’s just an empty file with a msg.post() with acquire_camera_focus. Put the call to acquire camera focus in the init function:
function init(self)
msg.post("/camera#camera", "acquire_camera_focus")
end
You can put generic Lua code, declare variables and go.properties and require Lua modules outside of the lifecycle functions, but most everything else needs to happen inside or as a response to an engine lifecycle callback such as init(), final(), on_input() etc
You’re the realest person! I actually did do the function init thing initially but it came up as a black screen so I second guessed myself. This time around, I just ended up messing around with the z-values for my game objects until they all showed up. I set everything at the same z-value. Thanks for your help and patience!