Coolio
Coolio

Reputation: 3

Actor moves towards the wrong axis in UnrealEngine

I am trying to run the airsim drone inside an unreal engine environment.After placing the actor start position on a custom environment for my drone and rotating the drone towards the way I want it to face, the orientation is all messed up during my runs. The drone moves towards the global coordinates of the environment and not the local ones I am setting. Is there any way to preset the axis and orientation of the actor? I moved the pivot and rotated the actor making the axis and the orientation aligned inside unreal engine, saved and packaged the project but after I run my scripts it still moves towards the global axis of the custom environment. The picture shows the axis and rotation before and after the alignment, thank you in advance for any kind of help!

rotation I want with the global coordinates,

aligned rotation and axis the way i want them but doesnt change during the run

Upvotes: 0

Views: 305

Answers (1)

Omrum Cetin
Omrum Cetin

Reputation: 1479

You need to work on following topics in order to address the issue permanently.

  • Euler Rotations (Understand Gimball Lock, Order of Rotation Problem)
  • Quarternions (Always have true rotations)
  • Coordinate Spaces

First things first its a standard behavior and you don't need to modify it. Understanding World Coordinate Space and Component Coordinate space is important here. (Also between your two images, you are swapping it) When you move character or pawn its moving over World Space, input calculations done in the same space. So when you give X axis, your character moves over Forward Vector. So don't play with orientation of character blueprint, when the mesh comes align it with capsule and take reference turquoise arrow make arrangements based on that.

Upvotes: 0

Related Questions