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"

Why not put code for world projected mouse cursor in player controller?

A new project created from the top down template for mobile includes some boilerplate code for some of the basic set up of a character. But in this template, the green decal that shows the mouse cursor location in the world (projected into the world through GetHitResultUnderCursor(ECC_Visibility, true, TraceHitResult)) is declared, created and updated not in the player controller or the HUD but in the default character .h and .cpp files.

So when I created my own character class I moved the code to the player controller since it is part of the player control interface. However, when I did this, the cursor stopped appearing in game. In fact, through logs I can show that it is being created, the decal material is being applied, and it is being moved to the correct location. However, no matter how I set visibility or IsHiddenInGame, it doesn't show up.

So there must have been a reason why the programmer at Epic who created the top down mobile C++ template put this chunk of code on the character instead of the player controller. I'm wondering if there is just some rule against the player controller directly spawning something in the world, or something like that.

Product Version: UE 4.19
Tags:
more ▼

asked May 24 '18 at 06:43 AM in C++ Programming

avatar image

Dragon Slave
43 4 7

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

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