Change Character Rotation When He Collides With An Object

Discussion in 'How Can I...?' started by AlexandreAbreu, Jan 7, 2017.

Tags:
1. AlexandreAbreuBoxer

Joined:
Nov 22, 2016
Messages:
7
0
So I have my character with a advanced move with angular velocity set to -2. I would like to change the rotation direction (clockwise to anti clockwise). This actually sounds simple, all I thought I had to do was add a transform tool that multiplies the angular velocity by -1. But under affected asset there is no option for my character.
I've also tried adding an action but no progress.
Would appreciate some help.

2. steverhaBoxer

Joined:
Oct 8, 2015
Messages:
49
16
Create an advanced move for the character, change the event to collision, choose the object desired as the affected asset, make the mathematical operation replace the angular velocity to 2, set timeout to whatever you wish. That should do the trick for ya, let me know if not.

3. AlexandreAbreuBoxer

Joined:
Nov 22, 2016
Messages:
7
0
ok, so I've tried that, and it changes the rotation but something weird happens, and i'm not sure I can explain.
One of two things can happen after I touch the object.
If I touch the object slowly my character will not move anymore only the camera moves.
And if I touch it by running into it my character will continue moving.
In both scenarios I lose control over my character.

4. steverhaBoxer

Joined:
Oct 8, 2015
Messages:
49
16
What is the timeout set to? If you want it to just switch the rotation to 2 quickly, try setting your timeout to about .001. If your character touches it slowly and stops moving, just mess around with the linear velocity in the advanced move for your character. Basically, if hes moving right at a speed of 5 on the x axis, make it so when he hits the object, changes rotation, and changes the speed to -5 on the x axis.

5. AlexandreAbreuBoxer

Joined:
Nov 22, 2016
Messages:
7
0
That does not work, if I set the timeout to .001 my character will change rotation but will stop rotating. I've also tried several timeout values and I can't really understand what it does.
I do not have any advanced move for the movement of my character I have full control over my character, in every direction.

6. AlexandreAbreuBoxer

Joined:
Nov 22, 2016
Messages:
7
0
I believe I understand what this is actually doing, and it's not what I want to do.
It only changes the rotation while my character is touching the object and when my character stops touching the object the rotation stops.
But what I want to do is change the rotation as soon as it touches the object and I want to keep that rotation for the rest of the game.

7. steverhaBoxer

Joined:
Oct 8, 2015
Messages:
49
16
Change your characters rotation drag to 0, that that way you can keep a continuous rotation going. If you set it to 0 then it will work. But, if its set to anything else then the characters rotation will eventually stop. Let me know if that helps.

8. ChristophMiniboss Boxer

Joined:
Oct 4, 2015
Messages:
2,807
2,309
If your character has a -2 rotation then put to the character's advanced move a +2 rotation (and affected asset to your object). Just the opposite and it will look like he turns from clockwise to counterclockwise.

playsgames6666 likes this.

Joined:
Nov 22, 2016
Messages:
7