I have done everything correctly, I just can’t get why the camera isn’t rotating to the character’s location? How can I make the camera rotates to follow where the character is going??
Thank you for your reply. I don’t know why it is not working myself that’s why I couldn’t give details. But yes the TriggerBox works because it changes to the targeted camera when I’m inside the box but the camera isn’t rotating! I will try to print the canRotate variable and will get back to you.
This is how I tested the variable, it gave me an infinite list of the word “true”. So I’m confused, everything seems to be working. but the camera isn’t rotating for some reason.
Yes, the camera not rotating was the detail we needed. Because there are a few things here- it could be not switching to that camera, it could be showing a black screen, and so on.
Try going off of the “Cast Failed” options on your casts and using a print string there- if it isn’t casting it’s not giving the return object.
If it is not failing, try right clicking the “As Binded Character Top Down” and promoting it to variable, then use that variable as the input for the “Get Actor Location” for the lookat node.
but as you can see there is a new node that got created by itself connected to the “As Binded Character Top Down”, I don’t know how to connect that node!
But I tried testing it anyways, what happened is, when getting inside the trigger box, the camera changes its looking direction but still not rotating.
but I got errors.
I guess the node that I left is what causing this error:
blueprint Runtime Error: “Accessed None trying to read property As Binded Character Top Down”
ok, I fixed it and tested the result. It is the same now, the camera is still not rotating , I really don’t know what the issue is, but my character isn’t walking for movement, instead it is crawling. Does that have to do with anything? I don’t think how he moves could be a problem, but I have tried troubleshooting multiple times now and all in vain
It should not. It should just say Rotation in this case. Besides this being a somewhat poor tutorial with a couple of bad practices, I also do not see why this wouldn’t actually work. It looks like it should, even if it’s not great.
Thinking more along the lines of what else could break this interaction in the way you’ve described.
the camera does switch to the correct perspective, right?
it just does not rotate, it does not track player movement. Is there perhaps something special about the movement while in the room? Perhaps you move just the character’s mesh rather than the entire character?
when you crawl back out of the room, does it switch back to the character’s camera?
In your game, will you be having more rooms / locations / situations where the camera needs to switch to a different perspective? Or is this a unique 1 time only situation that will not get repeated?
* the camera does switch to the correct perspective, right?
Yes it does, and when I’m outside the room it switches back to the previous camera.
How would I know that? How can I check if only the mesh is moving? I can see the character moving but I’m not sure if it is missing something.
yes, it switches back to previous camera, but I don’t have a character camera, every room/ hallway has a camera that all should be fixed and only rotating with the movement.
yes, every room/hallway has a different camera and it should switch to cameras according to where the player is, but all cameras should be in a fixed places but rotating with the player.
My suggestion is to take a different approach. Doing it all 1-by-1 manually in the Level Blueprint is not the best idea. You’d need to repeat this script dozens of times - once for each room / corridor / cut-scene. And your dev time is probably too precious for that.
Consider this alternative where each box trigger already has a camera inside.
create an actor with a Camera Component and Box Collision, disable Tick:
This approach makes the actor reusable so you can plop them down as many times as needed in any level:
This can be further improved, ofc - depends on the desired features and details. Here’s the project link in case you wish to quickly hop in and test out whether that would work for you:
Amazing, thank you so much, but before I start that and give you feedback. Can you please tell me how to make sure I’m not only moving the mesh? because if I’m, then even with these changes I would still get same issue.
isn’t there any way to do that ?, my character is like a ragdoll that’s crawls weirdly, that’s why the mesh was used. So now there isn’t any solution for that? it is hard to change the movement now.