I want the camera above the shoulders of each animal so as the animal walks, so your view is constantly over the head of the animal. I’ve spent more time trying different solutions than I want to admit.
It’s misleading to say the camera is following the animal. You can’t move an object, animal or otherwise, via the keyboard or mouse. You’re controlling the camera movement in space. So this code actually makes the animal follow the camera. It’s present the appearance of the camera following the animal.
I present three different possible solutions. The one that is most ideal is camTiger. It’s not perfect though because you have to turn of the camera collision.
CoSpaces gurus…
Can the camLion be coded to ignore collisions with charLion but react to other collisions?
How about creating a Follow mode, like there is a Walk and Fly?
Ignoring collisions on certain items for the camera is only possible via scripting right now. To do so, you can use this script:
//Find the item to be added to the collision filter
const myCharacter = Scene.getItem("charTiger");
//Add the item to the collision filter
Scene.camera.addToCollisionFilter(myCharacter)
Below is a remixable space which expands on your camTiger concept. Feel free to check out the scripts used in the space to learn how it was done. Let me know if you have any questions
All scripts run automatically after “Play” has been pressed
Custom scripts can not be called from within CoBlocks by design. We’d like to make sure that all CoBlocks remain functional after app-updates. If we notice certain functionality (such as ignoring collision of certain items) being requested often, we’ll consider adding it as advanced CoBlock.
You can define functions in scripting which can return values. However, taking a value from a script and using it in CoBlocks can’t be done right now.
Our internal CoBlocks are for debugging purposes only, so rest assured we’re not hiding any CoBlocks from you