hi.
I want shoot from a socket and rotate it for shooting to front of player;
I find socket location with firstPersonSkeletalMesh->GetSocketLocation(“MuzzleFlash”) but I think it is RelativeLocation of socket from skeletal mesh.
how can I find global location of this socket ? and rotate it for shooting to front of player ?
thanks
thanks for your help.
I take mistake in GetSocketLocation return value
Hi,
/**
* Get world-space socket or bone location.
* @param InSocketName Name of the socket to get the transform
* @return Socket transform in world space if socket if found. Otherwise it will return component's transform in world space.
*/
UFUNCTION(BlueprintCallable, Category="Utilities|Transformation", meta=(Keywords="Bone"))
virtual FVector GetSocketLocation(FName InSocketName) const;
So the GetSocketLocation returns socket location in world space.
For the direction you can use:
virtual FRotator GetSocketRotation(FName InSocketName) const;
or
/** Get the forward (X) vector (length 1.0) from this Actor, in world space. */
UFUNCTION(BlueprintCallable, Category = "Utilities|Transformation")
FVector GetActorForwardVector() const;
Regards
Pierdek