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 to check object position on spline an fire event

Hello everyone, I'm new to unreal Blueprints, and I'm stuck with a problem: How can I check if the object cube in the spline reaches different positions?, every time the object reaches one of the positions, an event is fired which changes the material into a certain sequence

[1]: /storage/temp/266567-splinequestion.jpg

Product Version: UE 4.19
splinequestion.jpg (290.7 kB)
more ▼

asked Jan 26 '19 at 06:22 PM in Blueprint Scripting

avatar image

3 1 1

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

1 answer: sort voted first

after your set world transform node just a add in a branch then off the true pin call your color change event. for the branch's input bool plug in a "OR" node, then for each input of the OR have a vector == vector. the vectors will be be the cubes location and the location at distance along spline where you want the event to be triggered.

more ▼

answered Jan 26 '19 at 06:44 PM

avatar image

10.1k 33 9 23

avatar image han7a Jan 27 '19 at 10:44 AM

Hi ThomsonN13 and thanks for the quick response, I hope I'm in the right direction, I'm assuming that my cube moves only in one position through the spline, what am I doing wrong?alt text

splinequestion2.jpg (267.1 kB)
avatar image originaltenka Jan 27 '19 at 08:36 PM

The problem is with the condition. What I'd do is put the spline points in an array and compare the spline point's position to the character's position and if they are the same set the condition to true.And if you actually want the position to be between 2 spline points, you can get the closest distance using abit of math https://www.geeksforgeeks.org/find-number-closest-n-divisible-m/

avatar image originaltenka Jan 27 '19 at 09:02 PM

Second: The spline is in the cube and I'm not sure what it is you want to do Do you want the cube to follow the spline? Are you moving the spline within the cube?...If so, wouldn't it be better to use local transform?

avatar image ThompsonN13 Jan 27 '19 at 11:04 PM

my intent was more akin to the following picture. using a or may not be the best method (it may need some tweaking due to performance differences in pcs) so instead here i just used two branches. the problem i see with your setup is that your not really comparing any vectors (they arent connected to anything).

alt text

capture.png (465.3 kB)
avatar image han7a Jan 28 '19 at 05:09 PM

thanks ThomsonN13 works!!, #originaltenka I wanted to do the following: At the main level the Cube and splaine will be placed every time I click a button.. the cube moves through the spline as soon as you touch it, then after a certain distance the Cube changes the color one of its sides, another stuck other side and so on.., and when the cube arrives at the end of the spline is deleted.

avatar image originaltenka Jan 28 '19 at 06:26 PM

I see...glad you managed to do it

(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