Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - 18LSC

Pages: 1 [2] 3
Action Requests / Re: Limit Look at Rotation
« on: April 06, 2018, 02:38:10 AM »

 here it is:

if you want the scene, let me know, but it's pretty straight forward.

 in terms of performances, you'll be fine really, how much of these do you think you are going to have in your scene?



Yeah I guess id have to take a look at the scene to understand how it works a bit better thatd be great :) thanks for all the work! :D

And Id probably have like 8-12 of them at most.

Action Requests / Re: Limit Look at Rotation
« on: April 04, 2018, 05:25:35 AM »

The question would rather be how would you like the constraint system to work in this case? the only solution I can see is to not jump but animate back the gameobject to go all the way across the range and hit the min limit instead of jumping to that limit. For this an easy solution is to build a rig where you have a child Gameobject attached to the camera at several units in the looking direction, and then have the real camera smoothlooking at this target, then as the constraint makes it jump, the smooth look at will smoothly transition from one limit to the other.

I guess this is your desireable behaviour right? like the head of a human, it would not jump from right to left, but actually rotate smoothly but fast from one side to the other. Correct?



Yeah thats about right, id like it if the target object goes from one limit to the other behind the object, the rotation will then turn back towards the other limit, instead of doing that instant flip, like a head just like you said.

One method I made to work was to have a childed objects with smooth look at always following the player updating its rotation.
And using 2 states, with the main object (head, camera) looking at the player only during one state, and if the 2nd "look at" goes past a certain rotation, it triggers the 2nd state, which stop the head rotating past a certain point. Only reactivating the 1st state if the target object is within a certain range of rotation again. Using float compare for the state transitions.
I just worry how performance costly this method is if I start duplicating multiple prefabs around.

I'm not quite sure how your described method works in comparison to mine, sounds kind of similar though.

Action Requests / Re: Limit Look at Rotation
« on: April 03, 2018, 07:52:07 PM »

 here's a screencast:

so you see that at the back, the min and max constraint swaps based on which side the target is.

Does that make more sense?



Yeah thats the same thing that happened on my testing, so this is unavoidable?

Action Requests / Re: Limit Look at Rotation
« on: April 02, 2018, 07:22:46 AM »

 that's because the constraint system check the angle between the desirable target and the min and max, so if it gets contraint from the max value and all of a sudden the desirable angle falls into a minimal constraint, than it jumps to the minimal value. That's what you see here.

 Try first with a -30 30 constraint and make your target rotate around the camera to understand the principle.

not sure there is a way out. how would you see the constraint transform behave when it jumps from max to min or min to max?





I tried -30 30 but I don't quite grasp the principle you're explaining sorry :/ not sure what you mean

Action Requests / Re: Limit Look at Rotation
« on: March 30, 2018, 09:00:56 PM »

 does it work with the simple Look at action?



I also tried it with 'Look at' in the same layout as you see, also didnt work :/

okay I tested a little more, some settings do actually work and it stopped it rotating, but after a certain number it will not work, confusing, I tried 0 - 160 degrees, it will stop at 160, but if i keep moving to the point of -160 (which only happens in game), it starts moving again :|

at some point of the objects rotation it goes into negative numbers, am I missing a step that converts the objects rotation to a full 360 degrees? why am I getting negative numbers?

heres a quick vid of what is happening, watch the Y axis in the top right, it will stop at 160, then it goes into negative numbers and moves again

Action Requests / Re: Limit Look at Rotation
« on: March 29, 2018, 07:51:09 PM »

 ok, success :)

 can you try this action o the Ecosystem: ClampRotation

you add that after the Lookat action ( lookat does it works, and then this action will constraint, so the order is important).

 I made this as a separation action, because it has a lot of usage, not just for look at.

 I also let you define the default local rotation, otherwise the action takes the current rotation as the default rotation to base its clamp and for the lookat, it would not work, as look at executes first, so the clamp would be around the newly rotated object, and that's wrong. you can modify the default rotation in real time, clamping will adjust :) and if you want to constraint on all three axis, then have 3 of these actions one for each axis.

 Let me know how it goes. If all is good, I'll wrapp it up with a nice editor debug lines to see what's going on in the scene view.



Gah sorry I missed your last reply when I posted my last! xD, thanks so much for working on this

I tested it today, and I'm not the wisest on all this math lol but I put the clamp after my "look at" player, but it isnt stopping the rotation, the cam rotates 360 still :/
Screenshot of my settings:

Action Requests / Re: Limit Look at Rotation
« on: March 27, 2018, 09:32:30 PM »

 I am on it, but I haven't found yet the best way to go about this as it's either to complex to setup or too limited in possibilities, so I'll keep trying.



Thank you for spending time on this I really appreciate that

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 20, 2018, 08:06:50 PM »
Have you tried putting Multiply above Add Force? For it to work exactly as I had it you need it to execute in the same order, so top to bottom, 1st Transform Direction, 2nd Multiply Vector3 and 3rd Add Force.

Is it important for you to get the transform direction every frame? If it's only required on throw I'd probably contain them together in one state and have a transition/global-transition leading to it. There are many ways you could approach this, how are you planning to instigate a throw? Do you have a central player controller FSM that monitors player input?

It's hard to tell what's really going on due to the image being quite tight, the second column for Transform Direction kinda makes it look like a screenshot on a screenshot. Probably besides the point anyway.

Wow okay I didn't realize putting multiply at the top of the stack would help but it did in this case, i just threw an object at the speed of light lmao

and yeah I had those 3 actions separated, but yeah I can see now that that isnt necessary :)

Im not sure what you mean regarding the "transition/global-transition leading to it", you mean have a in between state that only gets the players Z axis right before the throw? so Im not chewing up performance on every frame like I currently use

EDIT, I tested it and yes it works if I just add it to the unparent state that comes right before the throw state :D, thanks for all the tips, really helped me wrap my head around this and many other future actions I can apply this too

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 20, 2018, 05:24:51 PM »
I came across and still come across similar issues where I know every step of what I want to do but finding the best actions is difficult.

If you want to upload a screen shot of your state in play mode I could see if something stands out with the multiplier. The multiplier as I'm sure you can see gives you a decent way to control throwing power.

I only used Velocity Change as a quick means to an end, it ignores mass so it's pretty straight forward to get going. I'd recommend you use what works best, you may want a system that takes into account the weight of objects so that larger objects are only slightly heaved forwards, almost dropping at the player's toes. If you wanted that you'd possibly use Impulse force mode.

In case you've not come across it at the bottom of this link you'll see the force descriptions:

I regularly have to re-check it.

Okay well heres a screenshot of them during gameplay, both attached to the FPC.

The V3 is updating as you can see. I turned multiply back on for this but it works on or off, but making it "111" doesn't affect throw force

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 20, 2018, 01:19:00 PM »
One way you could do this would be to use "Transform Direction" to convert your player look direction to world space, then use "Vector 3 Multiply" to setup the power of the throw and finally use "Add Force" to propel the object.

I've attached an image for reference, in which "cube (6)" was the child object being thrown.

In your case you probably want to unparent the object just before throwing by using "set parent" and setting it to none.

Hope that helps!

Massive thanks! I knew what I had to do but didnt know how to apply it, your tips helped ;D

But, I was typing my reply that this didn't work at first, besides a tiny puff of a force added to the thrown object, but I tested a little more and it now works, but I dont quite understand why lol

My changes:
I took the "transform direction" settings you gave "Z=1" and changed that to a higher number on Z, and that was my issue, 1 gave a little puff of force, I changed that to 5, now it works, even if I disable vector3 multiply altogether it still works the same :/

I still need addforce as the last step, but now its taking the "transform direction" of the players Z axis and adding the force there, and it throws only in the direction I face, yay.
So Im not sure why the vector3 multiply wasnt being applied to the other method.

Though I have one question, why does addforce "force mode" use Velocity change and not Force?

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 18, 2018, 07:41:22 AM »
I'm still stumped on this one  :-\

I don't know what actions to use to always track the players forward axis they are facing, and add force to the held object from that direction every time.

Action Requests / Re: Limit Look at Rotation
« on: March 18, 2018, 07:38:11 AM »
There are Look At and Smooth Look At actions.
To prevent it from rotating into a wall or object I use a float compare. When x/y > or < the area of rotation limit, we move to a second state that stops the turret/camera following the player.
Simple Setup:
1st State: (make sure every frame is selected on all)
Get property on turret x/y rotation - store in float value "rotation"
Float compare - "rotation" > 90 -> go to 2nd state -  this is your upper limit of rotation
Float compare - "rotation" < 0 -> go to 2nd state - this is your lower limit of rotation
Look at or Smooth Look At -> Player Object

2nd state:
 To get it to re-activate, should the player re-enter the area, here are a couple of options:

1. Have an empty game object inside your turret that continues to look at the player. This object will rotate without affecting your actual turret. Track its x/y rotation and do a float compare. When the values are within range then go back to your tracking state.

2. Have 2 colliders that are being checked for onTrigger. One at the top range and one at the bottom range and when the player enters go back to your tracking state.

Hope this helps.

I actually ended up figuring out almost that exact setup using 2 states too lol, but my worry is performance cost, having 2 objects tracking the player constantly, multiplied over maybe 10 or so turrets/cams etc, it works but would you say its bad for performance?

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 14, 2018, 05:06:27 PM »
Can you show some images or a video on what you try to do?
Maybe i misunderstood what you mean.

Sure, I just want to add force to my held object regardless of its own axis or the world axis, I only want to use the players Z axis

Action Requests / Re: Limit Look at Rotation
« on: March 14, 2018, 05:49:39 AM »

 Woah, seems to have miss that post over and over again :)

I'll have a look at this.



Thank you Jean :) I look forward to using this in my project

PlayMaker Help / Re: Add force to parented object only on one axis
« on: March 14, 2018, 05:47:58 AM »
Maybe you can use an empty parent on the held object and then add force on that?

Many times i use multiple partents on a singe object. especially on the player

I fail to see how that would be any different, the empty would then also rotate when I pick it up, changing its axis just like before

Pages: 1 [2] 3