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 get the mouse owner ?

I am trying to make an object spawn on the owners mouse but anything I add on it keeps asking for a target, I dont know what to put here, please help me.

alt text

Product Version: UE 4.8
Tags:
more ▼

asked Jul 02 '15 at 05:48 PM in Blueprint Scripting

avatar image

Dannyk90
250 35 36 51

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

1 answer: sort voted first

Where is this logic contained? It appears to maybe be an actor blueprint? I think you have somehow gotten the wrong node for getting the player controller.

The GetOwningPlayerController node you are using wants a Camera Manager as the target. You can tell by the italic text beneath the name of the node. This blueprint does not appear to be a camera manager so it was probably copy pasted in or added without Context Sensitive on.

Try removing the node and adding a new GetPlayerController node and plugging that in.

more ▼

answered Jul 02 '15 at 06:21 PM

avatar image

RimmyD
2.6k 98 15 96

avatar image Dannyk90 Jul 03 '15 at 08:24 AM

the problem with that is it will only go to player 0, i need this for the current player that calls this function.

Also using your suggestion now spawns nothing :/

avatar image RimmyD Jul 03 '15 at 06:28 PM

Player 0 is the current player. The player integer only matters for multiplayer on a single client like a brawler or a fighting game like mortal kombat,

How are you determining nothing spawns? Have you tried printing the result of the spawn?

With your current setup you are going to spawn something that in no way has a relation to being on screen. The mouse position will be returned in pixels and not world units. I am guessing you want to spawn something in world units in relation to the screen space of the mouse; if so, then you will need to use something like GetHitResultUnderCursor and spawn at the hit location.

avatar image Dannyk90 Jul 03 '15 at 07:06 PM

ok thanks

please could you show me a picture of how it should be done ?

avatar image RimmyD Jul 05 '15 at 02:08 AM

Sure thing. This traces to the world under the mouse cursor and if it hits something it will spawn an actor at the location of the hit.

alt text

capture.png (167.7 kB)
avatar image Dannyk90 Jul 05 '15 at 07:49 AM

thankyou :D exactly what i was looking for!

(comments are locked)
10|2000 characters needed characters left
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