Hello, so I have a ball BP and I have made it to where my character can pick it up, and the ball snaps to the characters hand socket. Now what I am trying to do, is have the ball that he picked up, be able to be thrown. I am still some what new to BP but have been trying to figure this one out for almost a week now. I have screenshots attached to show my current settings for the Ball and Character.
This can help you start:
In Character:
In Ball:
PS: do not add a projectilecomponent in the component tab.
How did you get a reference to the ball in the character BP?
I also get a notification saying that DetachFromActor cannot detect static mesh
When your character collides with the “Ball” you get that actor’s reference and save it in a variable. In this case, it’s the actor resulting from casting the “Hit Actor” (from the linetrace result) to BP_Pickup actor in EvilCleric’s case, but in your case it should be “BP_Ball”.
Alright, i’ll take a look and let you know, Thank you for responding, this has been killing my brain for nights
Okay he also has this Event he calls Catch, i’m not really certain how he got that event there.
Oh nvm I believe I figured it out, i’ll confirm in a moment
Okay, so now when I have it set the way EvilCleric has it, I press E once I am in range of the ball to pick it up. I then LeftClick to throw the ball and it disappears from my hand. I do not see go anywhere it magically disappears haha. Any ideas why it is doing this?
So turns out the ball isn’t randomly vanishing, it is just dropping through the floor. Gonna play with the physics and see if it fixes anything
If it drops and goes though the floor then it’s because of 2 things:
1 - goes through the floor => you didn’t enabled physics when you throw (in “Set Actor Enable Collision” check the “New Actor Enable Collision” box)
2 - drop the ball => you didn’t set the speed and/velocity in “Add Projectile Movement Component”
I did that, now I weirdly got this
What exactly did you get?
The ball is there before I hit I play, and when I hit play it disappears through the ground
- Is the ball continuously falling?
- Does the ball have collisions enabled? If so, are you perhaps disabling the collisions on Begin Play?
- Does the ball have projectilecomponent? (it shouldn’t)
- Does the ball have “Simulate Physics” enabled?
This is my ball BP:
Okay so now I got it to where it bounces and rolls etc. But now I cannot approach it, and press E to pick it up. Any ideas?
So now I fixed that, but the ball bounces a few times after I throw it, then vanishes