Hi all,
I’m new to UE and Cesium. My goal is to spawn a player and dynamically load a map region using user-entered coordinates (input via UI). I was able to dynamically load the map region using the coordinates and a Cesium Cartographic Polygon to get the region I needed.
However, I’m stuck on spawning the player at runtime according to the user-entered coordinates. I tried adding a Cesium Globe Anchor component to the BP_ThirdPersonCharacter and changing its spawn coordinates, but it doesn’t seem to work. Maybe I’m approaching this the wrong way.
I’d really appreciate any suggestions for implementing this.
This is how i get the region i want (if you want to have a look):
It looks like your Blueprint is trying to move the Globe Anchor on the CesiumCartographicPolygon, not the BP_ThirdPersonCharacter. Otherwise, this graph looks reasonable to me!
Thank you for your reply. As I mentioned in my description, I was able to move the CesiumCartographicPolygon successfully and dynamically generate the region I wanted. My question is: can I move the BP_ThirdPersonCharacter in the same way after adding the Cesium Globe Anchor component to it? Or is there a recommended way of doing this when using Cesium to spawn the player at a particular coordinate?
The problem may be that BP_ThirdPersonCharacter doesn’t play by the “normal” Actor rules for positioning, so moving its CesiumGlobeAnchor doesn’t work as intended. If that’s the case, the character hopefully provides some sort of way to set its location in the Unreal world. If you can find that, then the next challenge is to figure out the Unreal world coordinates that correspond to a given longitude/latitude/height. While I can’t help you much with the character itself (perhaps a more general Unreal forum would help here?), I can help you with that last part. The trick is to call the TransformLongitudeLatitudeHeightPositionToUnreal method on your CesiumGeoreference Actor. Don’t forget that longitude is first (X), and latitude is second (Y).