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"

Firing towards mouse

Hello everyone, I've been trying to make a shooter for my platformer game. I've tried bunch of techniques, none of them worked as I desire.

I want my platformer actor to be able to fire towards where mouse is pointing, so I want to get the angle between its position and the mouse position. As my character is a ball moving around with AddForce (so its rotating while it moves) I wanted to store rotation and location where the projectile will be created from.

This was the closest approach I've found: alt text

The angle wasn't calculated correctly when I moved the mouse left side of the actor. It sets the firePos' Z rotation to -180 when the mouse is on its left, however, what I want to achieve is a 360 degree rotation (from 0 to 360), just like a topdown character, and not in between 90 and -90. I later removed the Z axis.

How can I make this work?

Any help will be appreciated

Thanks in advance.

Product Version: UE 4.19
Tags:
more ▼

asked Jun 16 '18 at 08:51 PM in Blueprint Scripting

avatar image

Epetha
1

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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