[Question] Is there a equivalent to AimNode?

In UDK we had AimNode in AnimTree which we can use to move certain bones with the camera. Is there a equivalent to this in UE4? Am using a single third person mesh and i have place the camera on characters head. But only the Yaw movement is updated. When i look up/down the camera moves but the players head wont follow it. Is there any way i can make certain bones (in my case i want Neck bone) move with the camera?

Plugin For You

Dear Satheesh,

I turned my BP library into a plugin

Now you can get my Aim Offsets BP Node WITHOUT having to compile any code!

Can be used in content only project!

http://forums.epicgames.com/threads/977316-Rama-s-Blueprint-Function-Library-As-a-Plugin-For-You!-No-Code-Compile-Required

Also features a Get-Recently-Rendered-Actors function, so you can tell what is being rendered and what isnt :slight_smile:

Rama

You are simply great Rama. Awesome work mate! :slight_smile:

See my Plugin for You answer

There is a very clear way to do what you want using Blend Spaces

If you look at the shooter game code you will see exact details.

I’ve fully implemented all directional aiming with the mouse using blend spaces and single frame animations for each of the 9 positions

From what I’ve read of your posts, you dont have easy access to shootergame example, so let me explain

Create 9 poses for

facing forward

facing up

facing down

facing left

facing right

facing upper right

facing lower right

facing lower left

facing upper left

Create these single frame animations in 3ds max by positioning character accordingly.

Then import the 9 animations

then turn them into a blend space using the following blend space setup

More numbers

the center is 0 0

straight to the left is yaw -90, pitch = 0, you get the idea

#Calculating the Pitch and Yaw

then you need calculate what the aim offsets should be

this involves a bit of c++,

though once you see the c++ you can probably figure out the blueprint version to run in your anim instance event graph

//I turned this into pseudo code for your blueprint adaptation, I got this from shootergame originally
void AVictoryCharacterBase::SetAimOffsets()
{
	//pc rot
	FVector LookDir = PlayerController->GetActorRotation().Vector();

    //some background info by me
	//Inverse of ActorToWorld matrix is World to Actor Local Space
		//so this takes the direction vector, the PC  rotation as vector
		//and outputs what this dir is 
		//in local actor space &
		//local actor space is what we want for aiming offsets
		
	FVector LookDirMadeLocal = ActorToWorld().InverseTransformVectorNoScale(LookDir);
	FRotator LookDirAsRotation = LookDirMadeLocal.Rotation();
		
	//Pass out Yaw and Pitch to Anim Instance for Blendspace
		//or in the blueprint case, makes these vars on your anim instance
		//make sure name is same as used by blendspace
	AnimationBase->VictoryAimYaw = LookDirAsRotation.Yaw;
	AnimationBase-> VictoryAimPitch = LookDirAsRotation.Pitch;
}

#My Attempted BP

I could not find a BP equivalent to

InverseTransformVectorNoScale

so I made what I think is an equivalent

I’ve not tested it though

basically I am using a transform, made in the animbp

I reset it to 0 every tick because then I ADD the actor local transform

and then convert the Player Controller’s look direction with the actor local transform

I think this is equivalent to the c++

but not sure :slight_smile:

Rama

I can Make a GetAimOffsets BP Library

Actually if you wait while do some testing and handle other life matters

I can make you a GetAimOffsetsBP that you can just plug in your AimPitch and AimYaw and your chosen actor and I can do the rest in C++

Rama

btw im almost done with this

just have to write up the forum documentation for it

already tested it as working

and made a whole bunch of other fun BP functions as well

See my Plugin For You Answer

#AimOffset Blueprint Function Library For You

I’ve tested with my own project that these Blueprint Aim Offset functions work!

So now I’ve done the hardest part for you, see my other answer for the rest of the process :slight_smile:

Rama’s Blueprint Function Library - Aim Offsets, Thick 3D Lines, and More!

http://forums.epicgames.com/threads/977316-Rama-s-Blueprint-Function-Library-For-You-Aim-Offsets-Draw-Thick-3D-Lines-amp-More!?p=31710453&viewfull=1#post31710453


**Current List of Functions**

**Aim Offsets, For Use With Blend Spaces in probable range of -90,90 to 90,90**

GetAimOffsets - Original Inspiration for this BP Library, This is a Blueprint version of the same core c++ code as Shootergame uses. With this function you can create a blendspace using 9 animations for the nine directions to create an equivalent of the UE3 Aim Node. You plug the results of this function straight into your Aim Blendspace. See Shootergame example for exact details.

GetAimOffsetsFromRotation - Instead of assuming you want to get the character's aim based on the controller, you can use this version to supply the rotation in world space that you want the character to aim to.

**Drawing 3D Lines of Chosen Thickness**

Thick3DLineBetweenActors - Draw a 3D line of your chosen thickness and duration between two Actors! You can use the BP color pick to pick line color!

Thick3DLineFromCharacterSocket - Draw a 3D line of your chosen thickness and duration from a specified Character Mesh Socket to your chosen destination. You can use the BP color pick to pick line color!

Thick3DLineFromSocket - Same as above, but you can use any mesh of your choosing.

**Conversions**
RotatorToVector
VectorToRotator

**Convenience**
GetControllerRotation - Get the Character's controller's rotation, fast way to get PlayerController or AIController rotation!

**File IO**
SaveStringTextToFile - Save human-readable text to a file of your choosing.