0
\$\begingroup\$

I am using LineTraceByChannel to cast a ray and return the name of the object it hits in my game world. It works but I am having trouble working out how to add the Y-axis (Up/Down) value. At the moment the ray is only cast horizontal to the ground, regardless of whether the player is looking up or down.

I tried adding a Pitch variable and getting the y-axis value but haven't worked out how exactly to use this. I followed a tutorial to get this far so any further advice is much appreciated.

This is my blueprint currently

enter image description here

The 'Selection Beam' component is attached to the character mesh, facing forwards:

enter image description here

This is where I get the input from the Mouse Y axis, if that helps:

enter image description here

\$\endgroup\$
2
\$\begingroup\$

I found the solution. Double-click your character to edit it. Look at the details panel on the right. Check the box next to 'Use Controller Rotation Pitch'. Thats it, simple!

enter image description here

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.