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"

Help With Turret

alt text

The picture supplied show a trigger box in front of the barrel and it moves with the level sequence set up.

i want to make it so when a player crosses the trigger box it shoots at the player. i have tried but cant seem to figure it out.

Product Version: UE 4.18
Tags:
turret.png (1.0 MB)
more ▼

asked Apr 19 '18 at 08:56 PM in Blueprint Scripting

avatar image

DrPineapple21
1 1 3

avatar image Nebula Games Inc Apr 20 '18 at 02:42 AM

post a screen shot of how you attempted to do this (need to see the blueprints, not just the 3D models in the viewport)

avatar image DrPineapple21 Apr 20 '18 at 10:09 AM

I haven't really got anything I have no idea how to approach this I thought I did but I kept running in to problems such as not being able to get the begin and end overlaps from the trigger box inside of the sentry turret object blueprint and could get reference to the barrel component that has the socket inside the main level blue print

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

2 answers: sort voted first

Easiest thing to do then would be to select the trigger box in the viewport. Open the level blueprint with the trigger box selected and right click in the level blueprint and search for "on actor begin overlap" that should pull up the overlap event. Once you have that go back to your viewport then select the turret instead, with the turret selected go back to the level blueprint and right click in the event graph and search for "create reference to selected object". Now you have a reference to the turret in the level blueprint. Within your turret blueprint you would script the "firing" mechanism and have it execute off of a custom event. So search for custom event in the turret blueprint and have that control the firing. Now back in the level blueprint, use the trigger overlap event and drag off from the bottom pin that says "other actor" or something like that, from that bottom pin cast to your player character. From the reference to the turret, drag off from there and in the search box find your custom event. Hook up the custom event to fire the turret to the success pin of the player cast. And that should do the trick.

more ▼

answered Apr 20 '18 at 10:45 AM

avatar image

Nebula Games Inc
4.9k 27 9 14

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

alt text So i believe i have set up what you have said correctly it could be and issue with my firing mechanism but so far nothing has happened.

alt text

turret-bp.png (302.1 kB)
cast.png (78.9 kB)
more ▼

answered Apr 20 '18 at 11:46 AM

avatar image

DrPineapple21
1 1 3

avatar image Nebula Games Inc Apr 20 '18 at 03:09 PM

It's not working because the "get player range" is a custom event that never is called. And even if it was it would only fire once. You need that on a timer, a timeline or tick to get it to continuously check if the player is in range.

(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