x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Lock the Mouse Position to the Center via Blueprints

Hi everyone!

I'm trying to make some FPS kind of camera, but I am unable to lock the mouse position to the center of the screen.

Is there any way of doing so? or would I have to set whatever I shoot to go directly to the center where the cross would be?

Thank you very much. :)

Product Version: Not Selected
Tags:
more ▼

asked Oct 13 '14 at 06:30 PM in Blueprint Scripting

avatar image

Bosha
1 1 1 2

avatar image Fieol May 13 '16 at 11:29 AM

Hey! I'm also working on this issue. You found a way out by any chance ?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I guess most Shooters just make a Line Trace from the middle of the camera straight forward and if this trace hits something it will deal damage. You won't really shoot something. Only emit a particle like blood, ground, rock, etc depending on what you hit.

The trace itself is a Node "Single Line Trace ... " the "..." is either for channel or objects.

There you can set a Start and an End Point. The Startpoint would be the middle of the camera (where your Crosshair is) and the endpoint the forward vector of the camera multiplied with the range the weapon should have.

For the start you would get the Player Character Position, add the height of the Camera to the Z axis (the height is the Z value of the Position inside your Components tab of the player).

The end would be getting the Camera Manager (by node) and getting the Forward vector of it. Multiply this vector by a float with the range you want and add the start position (the one you pluged into the Start of the Line trace from above) to it. Than plug this result into the End of the Line Trace.

Choose the objects or channels you want to trace and work with the hitresult. You can break the hitresult and get serveral things like the actor you hit or something.

EDIT: Here is a picture from a setup i made for this. This is some way to do it.

http://puu.sh/c1wg1/58a0679039.png

http://puu.sh/c1wg1/58a0679039.png

more ▼

answered Oct 13 '14 at 06:51 PM

avatar image

eXi
6.8k 332 184 464

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question