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 sit down on copied chair

Hello

I am making sit down possibilities. And I ran into a problem. When I interact with first chair, character sit correctly. But, when I want to copy my chair blueprint.  Then, I try to sit on second chair (copied). My character teleport on first chair. 

I have node "Get All Actors of Class" and I try to get arrow from ChairBP. But It doesn't work. And, I don't understood why. 

Help me please.  alt text

Product Version: UE 4.21
Tags:
2chairs.jpg (111.5 kB)
chairbp.jpg (171.9 kB)
characterbp.jpg (402.5 kB)
more ▼

asked Jan 25 '19 at 01:05 PM in Blueprint Scripting

avatar image

krovatka
8 2 3

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

2 answers: sort voted first

Do you see the "Get All Actors of Class" node and then the "Get" with 0 value? That means it will always get the "first chair" no matter what chair you approach. In UE4, "first chair" could be the first or the second chair. What you want is while querying all the chairs in the world, take note of their distance from your character and once you accounted all of them, choose the chair that is "closest" to your character.

EDIT: Below is an example:

alt text

alt text

example7.png (82.2 kB)
example6.png (290.8 kB)
more ▼

answered Jan 25 '19 at 01:16 PM

avatar image

Chyros
1.2k 8 4 8

avatar image Lolxh4 Jan 26 '19 at 02:24 AM

I would personally just make a line trace and sit in the chair that the trace hits, but that depends on whether the game is first or third person. Constantly getting all actors in a level and evaluating each can get performance heavy down the road. Your idea works too though.

avatar image Chyros Jan 27 '19 at 05:00 AM

Performance and design-wise, its better to use blueprint interface than a line trace or get all actors. I'm just expanding on his existing "Get All Actors" + Get (0) nodes to point out what's the problem with the current logic and how to fix it rather than give an alternative solution.

avatar image krovatka Jan 28 '19 at 05:17 AM

It is working! Thank you, for your help!

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

I modified your system. I set "my closest chair" into Chair BP. It will help me to create different chairBP with the same possibilitiesalt text

chairbp.png (78.4 kB)
more ▼

answered Jan 28 '19 at 05:33 AM

avatar image

krovatka
8 2 3

(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