- Where is the centre of movement?
- Updating the blinker centre.
- Projecting to the screen.
- Getting the screen size.
- Calculating the centre.
(Unique Video Reference: 15_AE_VR2)
We would love to know…
- What you found good about this lecture?
- What we could do better?
Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…
- Be in the correct forum (for the course).
- Be in the right sub-forum (for the section)
- Have the correct lecture tag.
Enjoy your stay in our thriving community!
My initial implementation of the reverse-sensing functionality unfortunately used the actor’s direction, which did not work and confused the hell out of me for a while. After much debugging I realised that the scene sets the player in the X=0, Y=-1 direction and only the camera changes rotation - not the player itself.
Basing the dot product calculation off the actor direction, therefore, led to some very odd results (mostly a black screen).
1 Like
I was having a bit of an head scratch figuring out the screen size using Unreal Engine 5.1, as the player controller returned 0 for both X and Y. Though reading the documentation it made sense, since there are no HUD elements on the screen, and thus GetViewportSize returns 0.
An alternative is to call GEngine->GameViewport->GetViewportSize(ViewportSize); where ViewportSize is an FVector2D. This returns the size regardless of HUD elements.
https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/Engine/UGameViewportClient/GetViewportSize/
1 Like