Hello
I want to fly object toward player when character enter to the collisionbox. I failed to cast bp player to get capsule location. what should i connect to the object pin?
And is there a easier way to to that? i know mine not the best sollution
Hello
I want to fly object toward player when character enter to the collisionbox. I failed to cast bp player to get capsule location. what should i connect to the object pin?
And is there a easier way to to that? i know mine not the best sollution
Hey, you can just add the Object to the event dispatcher as a variable. This way you can use the Object you get from your first cast when simulating physics.
Perhaps. Does the collision box belong to the player, to the flying object or is unrelated to any of them? You could try a Projectile Movement
component’s Homing
feature - that’s providing you must use physics because this behaviour does not require any unless it’s a specific design choice.
Besides that, if you have a Possessed Character, you can always access it like so:
Multiplying capsule relative location by 1000 is somewhat confusing, though.
Hey @Csak_Te!
Everynone has definitely got you most of the way there. What I would typically do here is use a LookAt node which will get you the vector between A and B (use Get Location nodes for getting start and finish) then multiply that by a Float to get your Impulse! Also just make that Float a variable for easy adjustment. It’ll be a lot more controllable than relative position as that can get crazy variable based on the locations you have, and not often shoot in the correct direction.
Hope this helps!
Apologies I don’t know why I forgot Look At returns rotations.
Similarly, but with a slight variation on a look at node, do this:
Start Vector (Object Location)
MINUS
Target Vector (Player Location)
Take that output and use “Normalize Vector” and use that in your multiply, then from there to Impulse. Sorry for the mixup!
it wasn’t bad solution, indeed its working with it
i tried this (i know its not elegant way but working somehow…)
im gona try this thoo
Worked!!! Thank you!
God bless u mate!