playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Rigidbody 2D face direction it is travelling.
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Rigidbody 2D face direction it is travelling. (Read 2014 times)
_adamturnbull
Playmaker Newbie
Posts: 18
Rigidbody 2D face direction it is travelling.
«
on:
March 24, 2014, 04:45:43 PM »
Hi,
Currently I set the velocity of my character at the beginning of the level and then let physics do the rest as it rolls down ramps and whatnot. Is there a way to make sure it always faces the direction it is travelling.
It is a 2D game so only needs to look left or right.
Thanks!
Adam
Logged
sebaslive
Hero Member
Posts: 572
Re: Rigidbody 2D face direction it is travelling.
«
Reply #1 on:
March 24, 2014, 08:16:51 PM »
Here is one of the ways, you can getvelocity and if it is positive you use a float compare to tell if less than 0 left event, more than 0 right event. The event that it sends it to can be set to flip it in the direction that you want.
Logged
All my VR games use Steam VR Playmaker Toolkit:
http://u3d.as/u20
And Oculus Touch Playmaker Toolkit:
http://u3d.as/QT5
Follow me @sebasRez
_adamturnbull
Playmaker Newbie
Posts: 18
Re: Rigidbody 2D face direction it is travelling.
«
Reply #2 on:
March 25, 2014, 11:19:14 AM »
Thanks, I'll try that. Are there any other ways or is this the best?
Is there a way to only send an event once if it goes below or above 0? Because won't it constantly keep sending the 'positive' or 'negative' events every frame.
Logged
sebaslive
Hero Member
Posts: 572
Re: Rigidbody 2D face direction it is travelling.
«
Reply #3 on:
March 25, 2014, 02:03:56 PM »
I am sure there are other ways which hopefully someone else on the forums can help out with but for the below or above 0 you set two states that link to each other. If its below send to left state if it is above you make the left state send to right.
Logged
All my VR games use Steam VR Playmaker Toolkit:
http://u3d.as/u20
And Oculus Touch Playmaker Toolkit:
http://u3d.as/QT5
Follow me @sebasRez
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Rigidbody 2D face direction it is travelling.