Problem spawning and launching actor

Hi all,

I am trying to create an event that spawns an actor, waits 1 second and then launches the actor.

This works fine with an overlap event with a sphere collision but I have set it up now as a custom event that should fire off a key press in my player character BP. I have been over it 20 times and don’t understand why it doesnt work. Any help would be much appreciated.

Screenshots to help


你的键盘输入事件写在哪个类里呢?,人物蓝图,还是player controller,两个都行,但是你得先在类默认值里面,开启事件接受输入,输入–》自动接受输入–》玩家0

1 Like

Hi Myspark,

Thanks for getting back to me.

I have put the keypress events in my player character and have now updated the input in both the character and the actor BP.

This has fixed it. Thank you so much for your help.

Hi,

Actually, dont think it fixed it. I created the event in the actor BP and the key press in my player character BP.

It works if I have the key press in the actor BP but not if I call the custom event from the actor BP in my player character BP.

如果你要在一个Class里去调用另一个Class的函数OR事件,则需要使用到BluePrint Communication,你首先得获得Actor BP的类实例引用,也就是他的内存地址,才能够访问他,否则UE的反射系统时不知道你这个Actor指的是哪个,最简单的方法就是
image
Beginpaly时,获取该类的引用,使用全局查找函数

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.