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"

How can I limit Aiming to screen space?

Hi, I've been trying to setup a control system for a new project. I have the movement system working as intended, with the UE4 logo as a billboard attached by a spring arm (so it reacts to objects in front of the player) as a placeholder for the reticle.

Now I want to set up the aiming to allow the player to move the reticle anywhere on screen, and to rotate the ship to face it.

I have tried a couple of methods but neither really give the desired effect.

  1. Rotating the ship, limited by a range of rotation from its spawn rotation. gif blueprint

  2. Moving the billboard itself then using Find Look at Rotation to set the ship rotation so its pointing at the reticle. gif blueprint

[SOLUTION]

So far I have managed to limit the players aiming, now I simply check if the input added to the players current rotation is larger than the rotation range I've set and clamp it. blueprint (horizontal aiming works the same but uses rotation yaw)

NOTE: This will limit the players aiming to a rectangular region, which in my case (designing twin stick controls) feels a bit clunky.

Product Version: UE 4.17
Tags:
more ▼

asked Oct 04 '17 at 10:39 AM in Blueprint Scripting

avatar image

Mafyoc
6 3 6

avatar image vivalabugz Oct 04 '17 at 05:20 PM

Do you have blueprints for aiming left/right?

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

1 answer: sort voted first

It depends on how you are moving the aim. I believe there is a function on player controller called Convert Mouse Location to World Space, that might be helpful since it gaves you origin and direction.

more ▼

answered Oct 04 '17 at 07:18 PM

avatar image

Iotti
524 1 4 8

(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