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 to build a reusable, controllable ball?

I want to make a football that I can apply impulse/force to it via a PlayerController, using the Blueprint system.

At first I setup a sphere StaticMeshActor in the scene, tweaked scale, mass, enabled simulate physics etc. And I converted it to a Blueprint class so that I can reuse it later.

I want to control the ball using keyboard or joystick, so I thought a Pawn is needed for the ball to receive input. So I created a Pawn and dragged the ball actor into the component tree, and replaced the root component with it.

There're a two things to implement: 1. receive input events, and compute the direction and strength of the impulse/force 2. apply impulse/force

I prefer implementing 1 in PlayerController, and 2 in the Pawn.

I learned that I have to get the StaticMeshComponent of the ball in order to apply impulse/force to it. The first question is, how do I do it in the pawn? As mentioned above, I have dragged the ball actor as the root component of the pawn, here I get an ActorComponent, how do I get the StaticMeshComponent of it?

The second question is, how to command the pawn to apply impulse/force in the PlayerController?

I'm new to Unreal, and am bewildered by the engine system, Please tell me if I'm doing right.

BTW, I a programmer and I played with Unity and Godot, I think they are easier to start with, especially Godot.

Product Version: UE 4.21
Tags:
more ▼

asked Jan 28 '19 at 12:09 PM in Using UE4

avatar image

linly
1

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

0 answers: sort voted first
Be the first one to answer this question
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