How to change rotation point (pivot) in Pawn class in c++ with blueprint child class(really need it urgently tough, any immediate help would be appriciated) : )
You can set the pivot offset in the details panel. Alternatively you can hold middle mouse and move it then right click Pivot > Set Pivot Offset.
Thanks, I also want to know why my pawn does not move, once physics is enabled ?
If you’re using the character movement component, it’s not physics based so enabling physics is going to mess with that.
How can I fix that ? I am not using character movement, I just set addworldoffset to the pawn on Input (spacebar) is pressed and if I enable physics It is not moving.
That’s not going to work if simulating physics. You would need to use AddForce.
I am trying to recreate Project Boost (from unity in unreal engine) if I add force the object moves in the same axis even after rotation (and not in the direction the nose cone is pointing to)
How are you adding force?
this->addforce(FVector(), this, false);
Where do you have this coded?
The first argument needs to be the force you wish to apply FVector()
is a default constructed FVector
whose members are not initialised and so you have undefined behaviour as AddForce tries to read its values.
I added values in there, but the it is not rotating in the direction the cube is facing (rocket boost unity for reference) it is moving the direction specified in the AddForce(FVector(0.f, 0.f, rotate * deltaTime), this, false) ;
Well you are always applying it in the Z axis. You probably want to be applying it based on the actor’s up vector.
How can I do that, can you help please (more info), thanks for the help provided already : )
not at all rotating : (
You would need more than that.
And I brainfarted earlier, you shouldn’t need the up vector.