'Unreal Engine 4 - can`t get variable from another BP
I'm new to UE and i trying to make my first game (block breaker). My idea in general is:
- When starting the game, the pad can`t move.
- When clicking, the player chooses the direction in which the ball should be fired.
- After the ball is fired, the pad can now move.
My problem is that I can't get the variable 'CanPlayerMove' from BP_Ball in BP_Player. I will be very grateful if you help me, and also accept suggestions for the code, game, etc.
Solution 1:[1]
I think the main issue, is -- well I dont ever see you actually spawning a ball. I see some Sphere component that is on your player being moved around.
If your goal is to spawn an Actor (BP_Ball), then reference it later, go for that! Spawn BP_Ball in your 'Spawn Ball' function, and keep that reference around for later.
If your goal is to use a BP_Ball that already exists in the world, then what your looking for is Get Actor of Class
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gedden |
