How to: Move to mouse click with Car Behaviour

Get help using Construct 2

Post » Thu Apr 16, 2015 4:56 pm

New around here, Hi,
I´v made an account since the classic times but only recently decided to dive in.

I´m trying to implement a top down car movement towards a mouse click/ touch, using the car behaviour. Instead of assigning keys to accelerate, decelerate, steer left/ right the car would "get" those commands by the distance/ angle toward the Mouse clicked point.

Is this a possibility or would be better to implement a custom solution like in this capx made by Cipriux found on this 2013 thread:

viewtopic.php?f=147&t=91054&p=714809&hilit=move+to+mouse+car#p714809

Its a "follow mouse" with "steerSpeed", with no behaviours. I altered it a tiny bit so it moves to a target instead of follow mouse.
But adding speed acceleration etc its beyond my efforts.

Any pointers?
working on Rally Racing
B
8
S
1
G
2
Posts: 48
Reputation: 1,076

Post » Thu Apr 16, 2015 5:42 pm

I thought I'd try..
Far from perfect, but might help within your brainstorm.

https://dl.dropboxusercontent.com/u/485 ... oveTo.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Apr 16, 2015 6:35 pm

Thanks for the head start LiitleStain :)
The car only makes left turns, will try to fix
working on Rally Racing
B
8
S
1
G
2
Posts: 48
Reputation: 1,076

Post » Fri Apr 17, 2015 9:03 am

ok. got it going using the clockwise angle comparison. capx:
https://db.tt/ieYDOtmV

Now I need to get braking and tune steering on the fly accordingly so it behaves more realisticalish
working on Rally Racing
B
8
S
1
G
2
Posts: 48
Reputation: 1,076


Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS, iBarin, Jhorbam, ninepixels and 16 guests