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"

Collision Detection for items that move to the player.

So there's this thing happening. I'm making a mod for hello neighbor and I've been getting something I can't really fix. I'm making a moving spotlight that would alert the neighbor upon being spotted. It would have a cone collision to match the spotlight and it only detects a collision when the player moves into the cone. Not when the cone suddenly overlaps the player. Is there a bit of advice anyone could give me?

Product Version: UE 4.20
more ▼

asked Mar 19 '19 at 04:23 AM in Using UE4

avatar image

Surniak Games
1 1

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

1 answer: sort voted first

If you are using SetWorldLocation / SetActorLocation make sure you have "sweep" selected, otherwise it will position the actor without updating the physics state, thus not triggering any overlap events.

Also make sure the collision response channels are set on both the player and the spotlight collision and "GenerateOverlapEvents" is set to true so they can see each other.

alt text

sweeptooltip.png (41.0 kB)
more ▼

answered Mar 20 '19 at 06:38 PM

avatar image

441 4 5 6

avatar image Surniak Games Mar 24 '19 at 04:08 AM

Yes, but I'm setting actor rotation, over a pivot that moves the entire thing from a corner.

avatar image Alekann01 Mar 24 '19 at 01:33 PM

Then you can use "SetActorRotation" or "SetWorldRotation" depending on if it's an actor or component. You also have "SetWorldLocationAndRotation".

If the objects overlap work fine when the player is moving around but not when you snap the spotlight on them. Then chances are, the physics is not being told their states.

Could you post screenshots of your code, please?

(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