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 could I build a spline and pass that to another BP?

Does anyone know how I could build a spline and pass that to another blueprint.

I have an blueprint actor and would like to pass in a spline as a path for it to follow. I tried creating an actor blueprint with a spline component as it's root, but I can't reference it from another blueprint.

Thoughts much appreciated...

Product Version: Not Selected
Tags:
more ▼

asked Jul 14 '14 at 06:06 AM in Blueprint Scripting

avatar image

tparkes
3 1 2 2

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

1 answer: sort voted first

You can have one blueprint use the spline in another blueprint but you have to figure out how you want to set it up.

Easiest way to do this, if you know exactly what you want at design time, is to create an Actor variable on your BP and set it to editable. You can then plug your BP with the spline component into that new Actor variable. Now you can easily reference the spline component on that plugged in actor. Here is an image of a quick version i made.

alt text

So on event begin play i use a timeline to move my blueprint along SplineActorTarget's spline (my variable with the other blueprint plugged in).

This could be handled more gracefully but i made it really quick. I cast the splineActorTarget to my special splined blueprint so i can get the spline component (named Spline1). My Timeline float track (NewTrack0) goes from 0 to 1 over 5 seconds. I plug the track's output into Time on a Get World Location at Time and use that location to set my actor location.

Any questions, just ask!

capture.jpg (79.9 kB)
more ▼

answered Jul 14 '14 at 11:47 PM

avatar image

RimmyD
2.6k 98 15 96

avatar image tparkes Jul 15 '14 at 12:06 AM

Hi RimmyD,

Thanks for this and your solution is almost exactly how I had envisioned doing this, but for some reason, If I create a variable of type 'actor' and make it editable, it states 'editing this value is not allowed'. The only way of selecting the actor I want is to drag both BP's into the scene outliner. I was trying to spawn my BP during the game, so I need to pre-populate the spline actor variable.

Any thoughts.

avatar image RimmyD Jul 15 '14 at 12:19 AM

For sure! You just need to find a way to link your specific splined blueprint in. This comes down to how your project works. Since i don't know much about your project I'm just gonna throw out some ideas and you can fire back at me any input!

  1. Whatever logic is spawning the new blueprint has a reference to the splined blueprint in the level and passes that into that SplineActorTarget variable. You will maybe need to set this up as a function like "SetSplineActor" so you can do any following logic in the new blueprint.

  2. When your new blueprint begins play it first does a get all actors by class of the splined blueprint class. It could check for a special tag or just use the first one it finds if you plan on having only one.

avatar image tparkes Jul 15 '14 at 12:33 AM

Resolved. Many thanks for your help. I ended up changing the spline actor var to a class, spawn it on start and then grab a reference. Works fine.

(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