Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jellyam on December 02, 2017, 10:33:03 AM

Title: add force isn't doing what i want[SOLVED]
Post by: jellyam on December 02, 2017, 10:33:03 AM
hello playmaker folks. I have quite a problem with add force not really doing what i want it to. I've set my add force to use self space when its adding force but it seems like i'm stuck in world space. It is adding force to a newly created object.

here's a clip showing what i mean
https://www.youtube.com/watch?v=D4UGYLZbmPQ&feature=youtu.be (https://www.youtube.com/watch?v=D4UGYLZbmPQ&feature=youtu.be)

i also have my playmaker setup attached
Title: Re: add force isn't doing what i want
Post by: 600 on December 02, 2017, 10:35:54 AM
In Add Force you need to set Vector or axis which one you want, like Z as forward. Put a value there.
Title: Re: add force isn't doing what i want
Post by: jellyam on December 02, 2017, 12:22:33 PM
i did do that right after i realized the picture didn't have a value in the y direction but it looks like its going by world space instead of self space you look at the little video clip. i set the y value to 20 and the mode right now is force
Title: Re: add force isn't doing what i want
Post by: 600 on December 03, 2017, 07:41:45 AM
Try with high numbers like 200, 2000, 20000 maybe the upward movement aligns it. Maybe can share screenshot of BlowFX inspector window too. How does the up move work?
Title: Re: add force isn't doing what i want
Post by: jellyam on December 06, 2017, 11:18:46 AM
right now my main computer's getting repaired and i won't be able to try other solutions until the weekend but i did try adding higher values to my add force and its still going up in world Y rather than local Y. I'll take a screen shot of the whole setup when i get my main computer back.
Title: Re: add force isn't doing what i want
Post by: omgitstri on December 06, 2017, 11:34:32 AM
Hello jellyam,

I think Self space only works if the object has a parent and it uses the parent's rotation.
You can use the Create Object Advanced action to set the object's parent when instantiating it then apply the force afterward.
Title: Re: add force isn't doing what i want
Post by: jellyam on December 09, 2017, 11:01:50 AM
https://www.youtube.com/watch?v=PvypLHNUq_0 (https://www.youtube.com/watch?v=PvypLHNUq_0)

hey guys, i'm starting to wonder if this a bug, I tried what you suggested omgitstri and got the same result, BTW thanks for suggesting the advanced create object action. I always like finding cool new actions. But when i was trying to figure out what was going wrong i noticed that the first object created actually does what i want it to. check the link to see what i mean

can anyone try the same little setup and see if they get the same result?
Title: Re: add force isn't doing what i want
Post by: 600 on December 09, 2017, 12:09:35 PM
Probably while the create action set the correct rotation, the object it self get the force push before it. Maybe better add the force by spawner to the spawned object, you can save in variable and then in next state add force to that spawned obj.
Can't rely putting some other state like you did with Set Float or other. Also the computing power in editor is slower, so on actual Build this can be a bug again.
Title: Re: add force isn't doing what i want
Post by: jellyam on December 11, 2017, 01:04:41 PM
i'm not totally sure what you mean 600, i tried using add force on the newly spawned object, that's how my original setup worked but i'm still getting odd behavior
Title: Re: add force isn't doing what i want
Post by: omgitstri on December 12, 2017, 09:23:39 PM
i'm not totally sure what you mean 600, i tried using add force on the newly spawned object, that's how my original setup worked but i'm still getting odd behavior

Hello jellyam,

I've try to put together a quick scene, here's what I got
Also, it turns out you don't need to set the object as a child, all I did was apply force to the object after I instantiated it.
(https://i.imgur.com/ebBwPj9.gif)
Title: Re: add force isn't doing what i want
Post by: jellyam on December 15, 2017, 01:25:48 PM
omgitstri can you send me a unitypackage to try it out?

I copied your screenshot and i'm getting better results, still not perfect, but are you doing anything with the arrow_rotation variable? its a little hard to tell from the pictures

Title: Re: add force isn't doing what i want
Post by: omgitstri on December 15, 2017, 01:32:34 PM
I'm only grabbing the rotation of the arrow, I'll make a unitypackage for you in a few hours, still at work lol. It might take a while for me to make the package though, i've never tried it before.
Title: Re: add force isn't doing what i want
Post by: omgitstri on December 15, 2017, 05:58:45 PM
Hello,

Here's the unity scene that i've set up. Hope this helps

I'm only adding the scene since i'm not too sure how to create a package sorry. And i made here that the actions used are teh basic one.
Title: Re: add force isn't doing what i want
Post by: jellyam on December 16, 2017, 10:41:59 AM
yay, we can mark this one as solved. it did take a little more fanaggling but I now have a working setup. thanks omgitstri for providing the scene =)

after getting the local rotation of the spawner, applying that to the both to the create object's rotation and to the addforce vector in self space got me the result i was after.

thanks all for helping me out with this