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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Why does Spline Mesh Component need an actor target?

Or rather, why can't the playerController spawn AddSplineMesh Components? I was moving a lot of my trajectory, aiming logic from my player actor to the playerController and for the life of me could not figure out how to fix my broken Spline Mesh. Turns out giving it the playerActor as its owner solved it. Its confusing to me because it seems the Spline Mesh component as well as spawning other components works just fine in the playerController.

Product Version: UE 4.12
Tags:
more ▼

asked Aug 05 '16 at 07:24 AM in Blueprint Scripting

avatar image

sarchasm
81 15 19 25

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

1 answer: sort voted first

Hey sarchasm,

I don't know why that would not work, could you maybe show a bit more of your setup in blueprint?

But to be honest I think this behavior should be inside the player pawn instead of the player controller, since your pawn should define what it can do. The player controller is nothing more than an actor telling which pawn player 'x' controls. This way a pawn can contain behavior disconnected from the controller. Take for example a CharacterPawn and a VehiclePawn. If the player jumps into the vehicle, the controller can just possess the VehiclePawn, without having all the code for how a VehiclePawn is behaving.

more ▼

answered Aug 05 '16 at 09:49 AM

avatar image

Roel
2.4k 69 42 141

avatar image sarchasm Aug 05 '16 at 05:27 PM

Ha, so this morning I went to remake what the issue was in blueprints to show you, since I had abandoned that attack and deleted all the logic. Turns out that when I went to remake it directly in the player controller that "Add Spline Mesh Component" it doesn't show up in the Context Sensitive list. Pretty clear now that my problem lies in the fact that, since my player blueprint had so much of the logic I was trying to port of... I duplicated that blueprint, then reparented it to the player controller class, which is how I got the node without noticing the issue.

The real issue here I guess is the fact that Unreal didn't give any warnings on the matter whatsoever, if you do add an Add Spline Mesh Component (by not using Context Sensitive) and leave the target for that node as "self" it just will not render, will not draw. If you do give it an actual instanced actor, it will work however.

And on the side note, thank you for the context around player controller. I hadn't really been using the class for the life of my project and kind of misunderstood it obviously. Glad to hear though that the direction I went after this mess up was the right direction... my motivation at the time was that, since my player actor had very similar logic to an ability actor I wanted to posses I felt I could some how put all the logic in a higher level node and then use it for both.... but in the end the ability actor logic was simpler anyways and its probably better that they're different.

Got it all working perfectly last night! Thanks!

(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